Problem with running php script using mysql on tomcat - php

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

Related

Composer windows 10 install error, PHP7, Xampp 3.2, Mysql 5.6.2 [duplicate]

Finally, after hours of strugling, I finished installing PHP 7.02 on our IIS 7.5 Windows Server 2008. All functions properly except for one error:
[20-Jan-2016 15:19:26 UTC] PHP Warning: PHP Startup: Unable to load
dynamic library
'D:\PHP\php-7.0.2-nts-Win32-VC14-x64\ext\php_mysql.dll' - The
specified module could not be found. in Unknown on line 0
When checking the downloaded zip-file op PHP 7.02 it's clear that the folder ext doesn't contain a file called php_mysql.dll.
So my question is where can we get this file to avoid this error?
Thanks to the comment of Naruto I figured out that the dynamic loading of all the modules in the php\ext folder wasn't the culprit. Because the file php_mysql.dll wasn't in that folder, so it couldn't be loaded from there. After further analyses it seems that in the latest PHP (7.02) download for Windows 64-bit the php.ini file still contains this:
[PHP_MYSQL]
extension=php_mysql.dll
After commenting out the section the error in the log file was gone. As we obviously can't load that dll file anymore.
;[PHP_MYSQL]
;extension=php_mysql.dll
mysql extension was deprecated on v5.5 and removed on v7 please check out link below, https://wiki.php.net/rfc/remove_deprecated_functionality_in_php7
For PHP 7.2 when using PDO for MySQL I had to un-comment the following line:
;extension=pdo_mysql
extension=pdo_mysql
It's worth noting that there are other versions of the PDO extension also commented out:
;extension=pdo_firebird
;extension=pdo_mysql
;extension=pdo_oci
;extension=pdo_odbc
;extension=pdo_pgsql
;extension=pdo_sqlite

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.

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.

Fatal error: Call to undefined function mysqli_connect()

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.

Categories