php extension on windows xp - php

I've installed php on my xp, but failed to add an extension to mysql
Here is what I did in php.ini:
[PHP_MYSQL]
extension=php_mysql.dll
and there is such a file in ext/
but when I look into phpinfo(), only to find that mysql extension is still not added.
What have I did wrongly?

In your php.ini file do the following:
extension=ext/php_mysql.dll
This should exist under the [PHP] configuration section, not [PHP_MYSQL].

[PHP_MYSQL]
wouldn't this bit cause problems?
guessing.

Are you using Apache? If so, check php.ini in apache\bin as this may be the ini file is use.
As Evgeniy Savichev pointed out, the name of the file being parsed is displayed in phpinfo under 'Loaded Configuration File'

Make sure that you have the mysql client DLLs installed and somewhere on %PATH%. Also, you can use a tool like depwalker to load the php_mysql.dll and see what the missing dynamic linkage is.

To avoid the configuration problems, I would install XAMPP (http://www.apachefriends.org/en/xampp.html) which installs php, apache and mysql and configures it all as a working server installation.

Related

Win10/Apache/PHP8: PHP cannot load pgql library [duplicate]

I'm installing PHP, Apache and PostgreSQL Manually
PHP and Apache now is connected, but PostgreSQL is not connected to PHP.
i test by using phpinfo();
i also configure in php.ini like this :
extension=php_pgsql.dll
extension=php_pdo_pgsql.dll
But why it's not work.
Thanks
This tutorial worked for me:
The PHP extension will look for libpq.dll which is found of your
PostgreSQL installation. The simple fix is to add the path than
contains that file to your environment PATH.
I had the same issue with PHP7 and Apache 2.4 on Windows 10. For me the solution was to add the following line to httpd.conf;
LoadFile "C:/php7/libpq.dll"
This also means that it's not required to have PostgreSQL installed if you just want to connect a PostgreSQL database that's not running on your machine.
1) Installing PostgreSQL for Windows
2) add to your enviroment variable "PATH" the bin folder of PostgreSQL installation:
C:\Program Files\PostgreSQL\9.2\bin; (for example)
Assuming you have installed PostgreSQL and your WAMP installation is on c:\wamp, you will need to copy
c:\wamp\bin\php\php5.3.9\libpq.dll to c:\wamp\bin\apache\Apache2.2.11\bin
Make sure you also have the following files
C:\wamp\bin\php\php5.3.9\ext\php_pdo_pgsql.dll and
C:\wamp\bin\php\php5.3.9\ext\php_pgsql.dll
Also, make sure you have enabled the above 2 files as extensions, either via the WAMP menu (click on WAMP icon on taskbar, PHP, PHPExtensions, find the above 2 and 'check' them)
Please note that php5.3.9 and Apache2.2.11 refer to my specific PHP and Apache versions.
Adjust those to suit your installation.
That's it!
This worked for me on Windows:
Found php.ini in php folder.
Found this line and removed “;”.
;extension=php_pgsql.dll
in my case there are 2 php.ini, I had to uncomment extension pdo_pgsql in both php.ini
in php folder
in apache folder
both inside in wamp folder
If you are using PHP in IIS, using PHP Manager, enable this extension:
php_pgsql.dll

php xsl extension missing magento readiness check

I'm trying to install magento on my Windows 10 system with MAMP PRO, and I have been getting the same error over and over for a while now. The magento installer says that my php xsl extension is missing. To install the extension, the manual says that I have to add the argument --with-xsl[=DIR] to my configure line but I have no idea how to do this.
I have added extension=php_xsl.dll to my php.ini file but it still isn't added. The php_xsl.dll is present in my /ext folder.
What could the issue be?
Uncomment the following line from php.ini file(remove ';' from the line)..
;extension=php_xsl.dll
in xamp/php/php.ini search and modify php.ini file, search ;extension=php_xsl.dll line, remove ; at the line start and save php.ini file. Then open xampp manager, stop Apache services and restart again.
This is because the XSL extension is not enabled.
To enable the XSL extension go to the location where the MAMP (or XAMPP) is installed. Then go to php/php.ini.
Un-comment the line extension=php_xsl.dll and restart the server.
Go to php.ini file
Change ;extension=xsl to extension=xsl
Restart your Apache xampp
First, stop apache.
Edit C:\xampp\php\php.ini
Only remove ; at the begiinning of the line extension=php_xsl.dll
Then start apache again
It will work proper.
You can solve this error simply by following these easy steps.
Stop the Apache server first
Then go to C:\xampp\php
Open php.ini file
Then uncomment all required extensions (;extension=xsl to extension=xsl)
Save it and exit
Then start xampp again and try to install
After what seemed like a million frustrating attempts, I finally came across this page and the note above. For some reason, the php.ini file in my MampPro php 7.0.9 was missing the intl and xsl dll (even though I kept uncommenting the ";"
Anyway - I saw the note above and was able to make the amends -- and voila, the issue was resolved.
I wish somehow this info was made available in php documentation and in MampPro site too. Hopefully, this won't be an issue in future patches or updates.
Go to your php root folder,
Copy all icu* * * *.dll files:
from C:\xampp\php
to C:\xampp\apache\bin
Are your other ext you've loaded in php.ini working nomarlly ?.(Try php_info())
And did you think u've download correctly .dll file.
I was installing Magento 2.1 on MAMP PRO WINDOWS (something that is not supported and not done) as a total newbie.
The same problem popped up intl en xsl extensions missing while ; was removed.
After trying everything I just looked at the php.ini location phpinfo()
C:\Users\Public\Documents\Appsolute\MAMPPRO\conf\php7.0.6.ini
Copied the php7.0.6.ini I changed on several locations an many times just into this windows directory and all my troubles were gone.
Magento is often installed on Linux. The title of this question above doesn't specify the server but the question does so I stumbled on this answer though I was looking for the Linux solution. So if anyone is looking for how to enable the xsl extension on Ubuntu, the answer is here: Enable XSL on Ubuntu 12.04
Search for php.ini in php fold and remove ; from ;extension=php_xsl.dll and you are good to go
The most upvoted answers are not telling you where to go to edit these files.
The correct path is: C:\MAMPPRO\conf\php(version number here)
Then you can remove the ; from the line extension=php_xsl.dll and restart the server.
In Installer.php line 545 error in magento 2.4.1
uncomment the following in your php.ini file by removing ";" for
;extension=intl
;extension=soap
;extension=xsl
;extension=sockets

PMA error : mbstring is missing

I am running on Windows 7 64 bit with:
Apache 2.2
PHP 5.2.8
MySQL 5.1 (essentials)
installed and configured manually. As you all know, for this since MySQL essentials has no GUI for interaction the best suit is PhpMyAdmin. I am trying to get phpMyAdmin-4.0.10.8-english, downloaded from the PMA website, into my Apache web server.
After all configuration work, now I get an error message when I try to log into PMA saying:
"The mbstring extension is missing. Please check your PHP
configuration."
In this forum it was mentioned that possible causes for this are the unavailability of php_mbstring.dll in php folder or else the extension_dir variable in php.ini is set to ./ which is the current folder.
I checked in the ext folder and the .dll file is available and the extension_dir variable is set to ./ext. And I tried setting the variable to C:/php/ext which is the absolute location, still it doesn't work. Any help on this concern would be much appreciated!
Probably the mbstring extension is just not activated in php.ini. Look for the line
;extension mbstring = php_mbstring.dll
and remove the leading ;
Also make sure that you are looking at the correct php.ini since there could be more than one in your installation.

How to enable PHP's openssl extension to install Composer?

I am trying to install Laravel in WAMP setup. I am getting a warning message for not enabling openssl which I had already done in WAMP.
Here is a screenshot of the message.
It is possible that WAMP and Composer are using different PHP installations. Composer will use the PHP set in the PATH environment variable.
If you want to enable the openssl extension to install Composer, first you need to check the location of the PHP installation.
Open a Command Prompt, type: echo %PATH% then check for the location of your PHP installation.
Go to that location and edit the file named: php.ini.
Uncomment the line extension=php_openssl.dll by removing the semicolon at the beginning.
Now you are good to install Composer.
I solved my problem a different way. The problem is that wamp's GUI was misleading: it claimed that I had php_openssl enabled.. and if I clicked on php.ini on the same GUI.. it actually showed that extension=php_openssl.dll was uncommented..
I'm not sure if i'm using the same installer version of composer of the OP, but it actually asks you at the beginning to specify the php.exe that you like to apply composer on (which basically ensures that no one tries to apply composer to the wrong php executable as what happened with the OP)..
The way I solved this was by going myself into the installation of php within the wamp package: C:\wamp\bin\php\php5.4.12 and looking php.in there.. when I opened it I was shocked that the line extension=php_openssl.dll was actually commented! I uncommented it and it worked just fine.
I had the same problem and here the solution I found, on your php.ini you need to do some changes:
extension_dir = "ext"
extension = php_openssl.dll
Every one here talks active the openssl extension, but in windows you need to active the extension dir too.
For WAMP server, comment given by "Enrique" solved my problem.
wamp is using this php.ini:
c:\wamp\bin\apache\Apache2.4.4\bin\php.ini
But composer is using PHP from CLI, and hence it's reading this file:
c:\wamp\bin\php\php5.4.12\php.ini (so you need to enable openssl there)
For composer you will have to enable extension in
c:\wamp\bin\php\php5.4.12\php.ini
Change:
;extension=php_openssl.dll
to
extension=php_openssl.dll
If you're doing this on Windows without one of the WAMP stacks, here's how to get this going
Download an installation of PHP for Windows. Generally you'll want a non-thread safe install. You can use 32-bit or 64-bit builds
Extract the zip file somewhere. I would suggest C:\php. Composer's installer found it there without any additional prompting
The latest versions of PHP for Windows do not come with a php.ini by default. Instead, you'll see two files, as noted below. Rename one to php.ini or copy it into php.ini.
php.ini-development
php.ini-production
Open your php.ini file and remove the semicolon from this line (you might want to uncomment other things as well but this line is the only one necessary for Composer)
;extension=php_openssl.dll
That should be all you need to do. The Composer installer should do everything else you need from here.
You need to enable "extension=php_openssl.dll" in both files (php and apache). my pc files path are these :
C:\wamp\bin\php\php5.3.13\php.ini
C:\wamp\bin\apache\apache2.2.22\bin\php.ini
This is an old question but I just had the same issue (with PHP7) and the solution was, in the end, pretty simple. Uncommenting the line in php.ini as per the other answers wasn't quite enough though. I needed to change it from:
;extension=php_openssl.dll
to:
extension=ext/php_openssl.dll
Note the ext prefix. The dll already existed but was in a subfolder. After changing the config the composer installer was happy.
you need to enable the openssl extension in
C:\wamp\bin\php\php5.4.12\php.ini
that is the php configuration file that has it type has "configuration settings" with a driver-notepad like icon.
open it either with notepad or any editor,
search for openssl "your ctrl + F " would do.
there is a semi-colon before the openssl extension
;extension=php_openssl.dll
remove the semi-colon and you'll have
extension=php_openssl.dll
save the file and restart your WAMP server after that you're good to go.
re-install the application again that should work.
There are two php.ini files, one for development and one for production. Leave those, there is another php.ini file for configuration settings just above them with a gear like icon edit that.
After editting the "right" files (all php.ini's). i had still the issue.
My solution was:
Adding a System variable: OPENSSL_CONF
the value of OPENSSL_CONF should be the openssl.cnf file of your current php version.
for me it was:
C:\wamp\bin\php\php5.6.12\extras\ssl\openssl.cnf
-> Restart WAMP
-> should work now
Source: http://php.net/manual/en/openssl.installation.php
I faced the same problem, but when i was lokking for php.ini and php.exe i found php.exe at C:\UwAmp\bin\php\php-5.4.15 when php.ini at C:\UwAmp\bin\apache.
I just copy php.ini at C:\UwAmp\bin\php\php-5.4.15 and Uncomment the line extension=php_openssl.dll and it fixed.
I am using WAMP server.
Actually its files showed that openssl is opened.
But manually I went to the folder and edited php.ini.
Then I found it has not opened openssl.I uncommented it and it worked after after WAMP restart.
C:\wamp\bin\php\php5.3.13
Browse to the line that reads:
;extension=php_openssl.dll
and remove the semicolon preceding the line. Restart your WAMP server services (click in your icon tray > 'Restart All Services'
If you still cannot solve your problem have a look at this. This might be the solution you are looking for
There are several php.ini files in C:\wamp\bin\php\php x-y-z folder. You may find production, development and some other php.ini files. No point of editing production and development files. Find the file which is exactly as same as the below image. (You can find it. Just type php.ini in your search bar and do a search). Open the file and remove ; from extension=php_openssl.dll. Save the file and close it. Restart all services in Wampp server. Re-install your composer.
That is it.
Wamp works with another php.ini that is in C:\wamp\bin\apache\Apache2.4.4\bin\php.ini. So you need to manualy find the correct file, that is in C:\wamp\bin\php\php5.4.12\php.ini. Uncomment the extension=php_openssl.dll line and just try to install Composer again.
For those who're having the same problem as I was. After doing all the solutions above, still didn't work for me. I found out that, uWamp was creating the PHP.INI file in bin/apache directory. So I had to copy the PHP.INI file into php installation directory, that is, bin/php/phpXXXX directory. This should also be where the php.exe is that you selected from the composer setup.
Hope this helps.
If you compiled from source, then adding extension=php_openssl.dll to the php.ini file may not work.
To troubleshoot this, open a command prompt and type php -i. Scroll up to the first line, it will tell you the most recent error regarding your php.ini file.
To solve the issue, find the php_openssl.dll file, for me it was in the very same directory of the compilation output:
C:\php-sdk\bin\phpdev\vc14\x64\php-7.0.13-src\x64\Release_TS
So just add the directory where the extension is, to the php.ini:
extension_dir = "C:\php-sdk\bin\phpdev\vc14\x64\php-7.0.13-src\x64\Release_TS"
Hopefully the error will be gone
If you are using xampp .Go back to where you choose which command-line php you want to use at the beginning of your installation and select the path where your xampp folder is included.After that if your installer says youve got duplicate 'extension=php_openssl.dll' comment one ssl file in your php ini with a ';'and your installation should run smoothly.

mysql is not enabled in phpinfo() of php 5.3.1

I am having apache 2.2.14, php 5.3.1 and mysql 5.1.43 installed on vista. I am trying since 2 days to configure php to have mysql enable on phpinfo().
I modified php.ini to have extension_dir = "c:\php\ext"
modified the extension as extension="php_mysql.dll"
added "c:\php" to the "PATH" environment variable and restarted the vista.
after trying many combinations of putting php.ini, php_mysql.dll and libmysql.dll in c drive and/or c:/windows and/or c:/windows/system32 now I am with no options!!
I do restart the apache after each modification. I used libmysql.dll present in mysql installation and that of older php version as php 5.3.1 has no libmysql.dll...
Any help will be appreciated.
Thanks in advance.
You have to edit php.ini and add/uncomment a line to import the php_mysql.dll extention. Search for ;extention=php_mysql.dll and remove the ;. If you find this line without the ; in front of it, you have another problem. If you don't find this line, add it without the ;.
You can also try to put a \ after the extention path: extension_dir="c:\php\ext\"
put php_mysql.dll in the "c:\php\ext" directory (and keep the extension="php_mysql.dll" uncommented [without the leading ;])
Make sure you've edited the right php.ini. In case of doubt
<?php echo 'ini= "', get_cfg_var('cfg_file_path'), '"';
will tell you which one is used by your php installation.
Maybe php tried to load the php-mysql extension and failed because of additional dependencies. That would cause a startup error entry in the error.log.
Which php-build do you use? The php-mysql extension can either use libmysql.dll as transport layer or the new mysqlnd (MySQL native driver) module. You've added c:\php to PATH. That's usually done in order to let windows find libmysql.dll (though it's not necessary, there are other methods which I prefer). If php-mysql depends on libmysql.dll and windows can't find it loading php_mysql.dll will fail.
But if you're using the php.net build of php 5.3.1 the mysql module uses mysqlnd:
Installation on Windows
In the official PHP distributions from 5.3 onwards, MySQL Native Driver is enabled by defaultThis module is built-in in the php.net build. You can test that by calling php -m in a command shell. It prints all built-in modules.
Thanks a lot to the user who said that we have to move the file php.ini to the folder /bin of the Apache server. it resolves me the same problem after more than one week of trying failed methods.
Of course we must uncomment in the file the two lines;
;extension=php_mysql.dll
;extensin_dir="ext"
by removing the semi-colon (;) and by specifying the full path for the extension library php_mysql.dll rather than ext as follows
extension=php_mysql.dll
extensin_dir="c:\Apache22\php53\ext"
For me I installed Apache in the folder c:\Apache22 and PHP in the folder c:\Apache22\php53, you must use your own values.
NOTE: Because mysql_ functions like mysql_connect() become deprecated in PHP 5.5 and above, it is recommended to enable also the library php_mysqli.dll to use functions like mysqli_ (improved version of mysql_ functions). To do that it is simple, you just have to uncomment the line:
;extension=php_mysqli.dll
in the file PHP.ini as follows:
extension=php_mysqli.dll
Update April 7, 2013. Installed Windows 8 on an i7 Quad, HT 8, 3.62GHz, 12GBRAM.. Installed the latest version of MySQL, got it functioning properly. Installed the latest version of Apache Web Server, got it functioning properly. Installed the latest version of PHP, got it functioning properly. MySQL could not connect to the database. The error message was "mysql_connect function undefined". I copied the modified php.ini file into the "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin", and restarted Apache web server... then it all magically started working.!!! I hope this helps somebody with setting up their own Windows MySQL / PHP web server.

Categories