I'm trying configure XAMPP to use with MSSQL. I'm following this: Example but I still had success.
I copied the files: php_pdo_sqlsrv_54_ts.dll and php_sqlsrv_54_ts.dll to folder c:\xampp\php\ext and configured php.ini in c:\xampp\php\php.ini.
In php.ini I activated the extensions: extension=php_pdo_sqlsrv_54_ts.dll and extension=php_sqlsrv_54_ts.dll and created PDO section. [Pdo_sqlsrv]
pdo_sqlsrv.log_severity=-1.
I am using XAMPP v3.2.1 and PHP 5.6.11
How could I make this works ?
For PHP5.6 vou need download SQLSRV32.EXE, after it put the php_pdo_sqlsrv_56_ts.dll and php_sqlsrv_56_ts.dll on ext folder and finally register those extension on php.ini, like this:
extension=php_sqlsrv_56_ts.dll
extension=php_pdo_sqlsrv_56_ts.dll
Restart apache and try phpinfo()or you could use getAvailableDrivers()
<?php
echo "<pre>";
print_r(PDO::getAvailableDrivers());
After a long time...
I am 3 days with this problem, with me only resolved after adding the correct versions of the PDO driver on this link.
My windows is 64x, but the XAMP is 86x. I only noticed after running phpinfo()
Note that the version you must add to the \ext folder is not the operating system version but rather the xamp installation, just like the image below:
Related
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
Environment in local system
MAMP 3.2.2
PHP 5.6.24
Webserver Apache
Mongodb for caching is installed successfully and found running in MongoDBservice.
I Downloaded Mongodb drivers from https://pecl.php.net/package/mongodb (used thread safe versions PHP5.6 "php_mongodb.dll") selected php_mongo-1.1.8-5.6-ts-vc11-x64.zip, Made changes to php.ini as extension=php_mongo.dll
I just copied and pasted .dll file in my C:\MAMP\bin\php\php5.6.24\ext
So far good... After restarting my MAMP I cannot see mongo in phpinfo ---->This is my issue
Any idea about this?
Thank you
Just copying the DLL file to the correct directory is not enough. You also need to add the following line to your php.ini file before the MongoDB extension is available:
extension=php_mongo.dll
After that restart Apache and MongoDB should show up as an available extension in phpinfo().
By the way, that is also mentioned on the official PHP website for installing the MongoDB driver: http://www.php.net/manual/en/mongodb.installation.windows.php
Should be extension="php_mongodb.dll instead of extension="php_mongo.dll as it is the name of the file you copied.
In my case, I first downloaded a x64 version of php_mongo.dll, which did not show in phpinfo page. Then i downloaded a x86 version and everything works fine. Hope this helps.
PS. Make sure you pick the right php version.
I have Apache 2.4.12 and php 5.6.9 on my Windows 8 computer and I'm trying to enable the curl extension for php however, I haven't had much success. After searching the internet for this issue it appears that other's have had the same trouble. Here are the suggestions I've found:
Uncomment ;extension=php_curl.dll in php.ini
Uncomment ;extension_dir = "ext" in php.ini
Download and replace the php_curl.dll file in the ext directory of php with one from this website
Add to the PATH environment variable where php is installed
Copy libeay32.dll and ssleay32.dll from where php is installed to C:\Windows\System32
I've tried every single suggestion with no success except the third item in the list because it doesn't have a .dll file for curl with php 5.6, in fact the highest version avaible is one for php 5.4. There has to be way to enable this extension without having to downgrade my php version to 5.4 and using a .dll file from that website. I've tried searching the internet for a .dll file like the one on the linked website for php 5.6 opposed to a version of php that's outdated but I've had no luck in finding one so I'd like help with this issue.
How can I enable curl for php 5.6 on my Windows 8 machine?
Locate your php folder and follow these instructions:
Move to Windows\system32 folder:
libssh2.dll, php_curl.dll, ssleay32.dll, libeay32.dll
Move to Apache24\bin folder
libssh2.dll
Uncomment extension=php_curl.dll
Note: Don't overwrite when prompted.
Source
I give you an example of a set up that just worked perfectly for me :
downloaded the VC11 x86 Thread Safe version of PHP,
unzipped it within a directory C:\php,
edited the php.ini-development, uncommenting 2 lines :
extension=php_curl.dll
extension_dir = "ext"
saved this file under php.ini.
I just tested it via the CLI (windows CMD here) on a PHP a file (i.e. C:\php\php myFile.php) and cURL worked.
If you have Apache installed and prefer to test it in a browser, you obviously have to adapt this installation with your own files structure and to do not forget to restart Apache.
Running apache service with a specific user other than local system solved the problem for me. You can test this easily by stopping the apache service and running manually <apache dir>\bin\httpd.exe.
I fixed this problem by adding C:\php and C:\php\ext to PATH system variables.
Press window + pause to bring up the System Properties page.
Click Advanced System Settings
Click Environment Variables
You'll see the Path variable in the System Variables box in the bottom.
Append your PHP path to that variable. Now the system will be able to load the extensions.
In addition to uncommenting the line
;extension_dir = "ext"
Try also setting it to the absolute path of the PHP installation's ext folder and then restarting apache.
e.g.:
extension_dir = "C:\PHP 5.6.19\ext"
I installed XAMPP 1.7.4(VC6) from this link:
http://www.apachefriends.org/download.php?xampp-win32-1.7.4-VC6-installer.exe
The XAMPP 1.7.4 contains:
Apache 2.2.17,
MySQL 5.5.8,
PHP 5.3.5
Then, I installed PostgreSQL 9 (64bit).
It's very simple to enable PHP and PostgreSQL connection - just uncomment extension=php_pgsql.dll and extension=php_pdo_pgsql.dll in the php.ini file.
But, I got an error when starting Apache:
Can anybody help and explain?
May be you can fix it with follow this instructions.
If the above doesn't work, try copying the libpg.dll file from your PostgreSQL installation folder over to your apache/bin folder
I had the same problem. I just copied the lib*.dll files from pgsql/lib/ directory to the apache /bin directory. It worked fine.
Simply navigate to your Postgresql/psqlODBC/0900/bin and copy all contents here to your xampp apache/bin directory, then restart Apache. This worked on my xampp 1.7.4.
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.