Fatal error: Call to undefined function mysqli_connect() - php

I have installed WAMP. I am using Tomcat 6 to run my PHP scripts. I am also using JavaBridge.war and I have copied my php scripts into \webapp\JavaBridge\project.
I have removed the semicolon from php.ini file before the statements
extension=php_mysqli.dll
extension=php_mysql.dll
I have added C:\wamp\bin into my PATH env variable. I have copied all dll's from C:\wamp\bin\php\php5.3.0\ext into C:\windows\system32
I am still getting this error.
Fatal error: Call to undefined function mysqli_connect() in C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\project\pf_query.php on line 534
I don't get this error when I run my PHP script from Apache 2.2.11 included in the WAMP package.

Did you edit the correct php.ini file?
<?php echo 'ini: ', get_cfg_var('cfg_file_path');
(executed in the tomcat6 environment) can tell you.

Just in case someone else has this problem, I needed to set the extension_dir variable to point to my php installation.

Related

Fatal error: Call to undefined function mysqli_connect(). I've tried everything, and I'm out of ideas [duplicate]

I have installed WAMP. I am using Tomcat 6 to run my PHP scripts. I am also using JavaBridge.war and I have copied my php scripts into \webapp\JavaBridge\project.
I have removed the semicolon from php.ini file before the statements
extension=php_mysqli.dll
extension=php_mysql.dll
I have added C:\wamp\bin into my PATH env variable. I have copied all dll's from C:\wamp\bin\php\php5.3.0\ext into C:\windows\system32
I am still getting this error.
Fatal error: Call to undefined function mysqli_connect() in C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\project\pf_query.php on line 534
I don't get this error when I run my PHP script from Apache 2.2.11 included in the WAMP package.
Did you edit the correct php.ini file?
<?php echo 'ini: ', get_cfg_var('cfg_file_path');
(executed in the tomcat6 environment) can tell you.
Just in case someone else has this problem, I needed to set the extension_dir variable to point to my php installation.

Getting error while connecting postgres to php

Hi i am trying to connect postgres server with PHP onm windows with xaampp. I have enabled the extension php_pgsql.dll in php.ini. I have also give the libpq.dll path to httpd.conf.
But still i am getting error Fatal error: Call to undefined function pg_pconnect() Any solution
I used postgres9.2 bin folder and load the libpq.dll in httpd.conf It solved my problem. I think there is some version compatibility first i was using 9.4 postgre bin files which was not working.
I added this line to Loadfile "C:\Program Files\PostgreSQL\9.2\bin\libpq.dll" httpd.conf
And remove ; from extension=php_pgsql.dll
After restarted the sever solved my problem.

Fatal error: Call to undefined function mb_detect_encoding() in windows

I have the following error when try to install phpmyadmin in 4.0.4 on PHP version 5.4. I am running Apache 2.2 on My Windows 7. I can run . My php is installed in c:\php. I have add the following line in php.ini but no lucks.
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_exif.dll
And also this line in php.ini
--enable-mbstring=all
Fatal error: Call to undefined function mb_detect_encoding() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\phpMyAdmin\libraries\php-gettext\gettext.inc on line 177
I checked the phpinfo() page but it does not show that mbstring is enabled. But I did
extension=php_mbstring.dll
So why the mbstring is not started?
Thanks.
what can I do to fix it?
Thanks
in php 5.5.8 and the php.ini file find the part called Windows Extensions and be sure that the extension php_mbstring.dll is uncomment (remove semi-colon at first) and be sure to appropriately set the extension_dir directive.
Check to make sure your php.ini file is in the correct directory. By default the path should be C:\Windows\php.ini. You can find out what it's looking for using phpinfo().

Enabling cURL with PHP

(I'm running Apache 2.2 and PHP 5.4.14)
I'm having problems enabling cURL with PHP. I uncommented the extension=php_curl.dll line in php.ini and made sure that the dependencies libeay32.dll and ssleay32.dll exist in the path. I also restarted Apache. However, when I run phpinfo() I do not see a cURL header and trying to call a cURL function results in the following error:
Fatal error: Call to undefined function curl_init() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\boxproject\php\lib\Box_Rest_Client.php on line 114
Does anyone see any problems with this process? Are there more ways to troubleshoot the problem? Thanks a lot for the help.
Step1: Uncomment the php_curl.dll from php.ini
Step2: Copy the following three files from php installed directory to the bin directory of Apache
libeay32.dll, libssh2.dll, ssleay32.dll
Step3: Restart apache.

Problem with running php script using mysql on tomcat

I am using tomcat 6 with JavaBridge. I have stored my php script in the following location.
C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\project\test.php
In test.php I am using curl and mysql. The php.ini in JavaBridge is stored in the following location
C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\WEB-INF\cgi\php.ini
and its contents are -
extension_dir="C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\WEB-INF\cgi\x86-windows\ext"
include_path="C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\WEB-INF\pear;."
there is also a config file called mysql.ini whose contents are -
extension = php_mysql.dll
I had also installed wamp earlier so I copied all the dll's from C:\wamp\bin\php\php5.3.0\ext to C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\WEB-INF\cgi\x86-windows\ext
When I start tomcat and run my script I get the following error -
Fatal error: Call to undefined function mysqli_connect() in C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\project\test.php on line 534
Please help.
If not enabled you have to enable curl in php.ini by uncommenting:
extension=php_curl.dll
I solved the problem...actually my wamp has php 5.3.0 and the JavaBridge php.info() says its is 5.3.1. I copied the new dll's and it is working now. Now I get an error: undefined function curl_init(). For the benefit for someone who is also facing the same problem. I copied the following dll's -
libeay32.dll
ssleay32.dll
into C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\WEB-INF\cgi and wrote the following line into mysql.ini
extension = php_curl.dll
and copied php_curl.dll into C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\WEB-INF\cgi\x86-windows\ext

Categories