MySQL through PHP through Apache on Windows dont work - php

I am working on a Windows 7(x64) with Apache 2.4 x86, Php54 x86
and MySql 5.6 x64.
PHP is working well on my Apache Web Server.
When i run PHP from CommandLine : php dbTest.php it runs without problems
but when i try to load my page, i get the error Fatal error: Call to undefined function mysqli_connect() in <path to dbtest.php> on line 3
tried installing PHP 55 but nothin...
Tried putting libmysql.dll in (php dir, win/system32, apache bin)
installed VC71 runtimes (because i saw it in a troubleshooting guide)
Edit:
- also tried installing all x64 (Apache and PHP)
- tried to install Apache v2.2 and PHP v5.3,
Nothing works...
how come running the command-line works but through Apache, it isn't working?
i see mysqlnd listed, but not mysql/mysqli, as if mysqlnd was the module...
Thank you for your time.
and for saving me the last few hair i have!

PHP 5.4 comes with mysqlnd installed by default so you shouldn't need libmysqli.dll
Does phpinfo() list a mysqli block?

You need this file in ext directory php_mysqli.dll

Related

How can i install the php-pgsql on windows?

whenever I initiate my localhost webpage, it returns me
Call to undefined function pg_connect()
And i found out the am missing the php-psql on it. Now, how can i install it on windows as all the threads regarding that are on a Ubuntu environment.
I too had the same issue where pdo_pgsql and pgsql were not loading in PHP 7.1.8 even though I had the latest PostgreSQL 9.4.6 and Apache 2.4.26 on Windows Server 2016. The solution was pointing Apache's httpd.conf to the correct libpg.dll in PostgreSQL/bin folder. Then the modules loaded correctly in PHP 7.
See pgsql extension is not loading

PHP CURL not loading in WAMP after upgrading PHP from 5.3.4 to 5.3.22

I have the exact same issue as PHP cURL not working - WAMP on Windows 7 64 bit
CURL doesn't load at Apache restart, with message: "PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.3.22/ext/php_curl.dll' - The operating system cannot run %1.\r\n in Unknown on line 0"
Except that I am not installing 5.3.13 as in the other thread but I am attempting to upgrade PHP in an existing WAMP installation from 5.3.4 to 5.3.22, both x64 VC9 TS on a Win 2008R2 64 bits, running Apache 2.2.4 x64.
I did the following steps:
stopped Apache
unzip php5.3.22 in /wamp/bin/php5.3.22;
updated php.ini, httpd.conf and the 2 Wamp config files to point to the new PHP version;
updated php5ts.dll and php5isapi.dll in Apache\bin with the new ones
updated Windows PATH to point to php5.3.22 folder instead of php5.3.4
restarted Apache -> CURL load error message
I could try most of the answers provided in other threads except the one from Matthieu:
Go to http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/ and download the curl version that corresponds to your php version under "Fixed curl extensions:".
...as there is no "Fixed curl extension" for 5.3.22 in Anindya's site.
Does anyone know if there is need or not for a "fixed curl lib" after 5.3.13? and where I can find it?
Either there are some typos in your question or you have done a few things wrong.
The new PHP should have gone into \wamp\bin\php\php5.3.22
updated php5ts.dll and php5isapi.dll in Apache\bin with the new ones This is done by Switching versions in WAMP, you dont do it manually
updated Windows PATH to point to php5.3.22 folder instead of php5.3.4 There is no need to put PHP on the PATH, in fact it reduces the ability of WAMPServer to switch between various versions of PHP.
Have a look at this it may help How to install a version of PHP into an existing WAMP install

curl is not working on php 5.4.3 of wamp server

I am using wamp server that installs php version 5.4.3 and I enabled curl extension, edited php.ini files to uncomment curl extensions lines but the problem is that when I try installing composer using console, it gives me a message that says "PHP Startup: unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_curl.dll", here is a screenshot of it
I followed instruction from different posts, downloaded curl versions from anindya but with no hope..
Thanks in advance for your time
Make sure your dll is compiled for the version of PHP you're using. So one compiled for 5.5 won't work on 5.4, etc. There's a link in this question that's relevant
PHP cURL not working - WAMP on Windows 7 64 bit
It sounds like you are running a 32bit PHP and have downloaded a 64bit version of PHP_CURL. That wont work
This dll should come as standard with WAMP's PHP's.
Are you sure your problem was not that you forgot that when running PHP in CLI mode you have to configure it using the 'php.ini' file that lives in the c:\wamp\bin\php\php5.4.3\php.ini
So if you uncomment the php_curl extension line in that file it should have worked, until you downloaded the wrong curl dll.
So get a 32bit curl dll for the correct version of php and try again.

MSSQL error (saying not enabled when it is) using WAMP / PHP 5.3.4

I am getting an error:
"Fatal error: Uncaught exception 'RuntimeException' with message 'The "mssql" extension is not loaded' in ..."
Though it is enabled. In php.ini (PHP version 5.3.4) it is uncommented out (no ;) before extension=php_mssql.dll and its showing up as checked off on the PHP extentions list in wamps system tray menu. What might be causing this?
Also semi related, I can't run php version 5.3.1. I downloaded and installed it but when i switch to it in wamp, the wamp system try stays yellow (instead of white indicating its ready to go). And no php loads anywhere / can't get to localhost or phpmyadmin at all. I tried to run 5.3.1 as a work around for this mssql error.
I am running WampServer Version 2.1 on a windows 7 64 bit box. This same exact setup works just fine on my windows XP (32-bit) box running 5.3.1.
Same issue. My apache log is showing
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.3.4/ext/php_mssql.dll' - The specified module could not be found.\r\n in Unknown on line 0.
I have the same issue with the ZIP module. The modules are legitimately not there.
I tried downgrading to PHP 5.3.1 from http://www.wampserver.com/en/addons_php.php, but then my Apache wouldn't start up at all; I'm guessing that was an x64/x86 issue.
Then tried copying the php_mssql.dll from 5.3.1 to my 5.3.4 directory, then restarting apache and it was just more fail with
PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.3.4/ext/php_mssql.dll' - %1 is not a valid Win32 application.
Installing WampServer 2.1e (the active build) but 32-bit to see if there were any differences. There were. This build packages PHP 5.3.5, which still doesn't include php_mssql.dll. BUT I was then able to use PHP 5.3.1 I had downloaded (apparently it is capable with this WAMP Build, whether because it's 2.1e or because 32-bit, I don't know or care).
So, the point of the story is that if you're trying to use WAMP Server with PHP's MSSQL extension, you're going to want Wamp Server 2.1e (32-bit, specifically) and PHP 5.3.1.
Also note, I still can't get the ZIP extension working with this setup, but luckily for me it's not essential to my current project.
Hope that helps someone.

Compiling PHP 5.1.6 from source - php -v and phpinfo() version discrepancy

I have just bought a VPS running Ubuntu and I need to install the LAMP stack with PHP 5.1.6. The VPS came with no PHP installed (checked this from the shell with php -v) and with Apache/2.2.12 installed. I installed PHP 5.1.6 from source and compiled it with Apache 2.2 (using libapache2-mod-php5), tried a phpinfo() test which worked fine, however, phpinfo() shows the PHP version as 5.2.1 (with JSON enabled), whereas running php-v in the shell shows as 5.1.6. Anyone any ideas what might be happening here? I need to ensure I am running PHP 5.1.6.
Thanks in advance for any help!
php -v gives you the version of the cli installation of php, while phpinfo will give you the version which got installed as apache module.
If you are not using cli php anywhere, you should be fine with running php scripts off apache.
But ideally you should fix this.

Categories