I had a perfectly running local test environment with:
Oracle Linux 7 using httpd
PHP 7.4
Oracle DB 18c XE
several vhosts
Then I had to install the IMAP extention, and got this final message.
My local pages don't work anymore, and a look at the error log confirm my suspicion that it's because something happened to the OCI8:
PHP Fatal error: Uncaught Error: Call to undefined function oci_new_connect() in /var/www/
Finally, phpinfo() shows that there is indeed no OCI8.
Has anyone a way to solve this without much fuss? I checked and the correct OVI-8 version is still on my machine.
Related
We're upgrading our server infrastructure on Amazon and I'm attempting to migrate a PHP site based on CodeIgniter (version 1.7.2) to a new server which has AmazonLinux as the OS. The previous server was Ubuntu, running PHP 5.3.3-1ubuntu9.5 on apache2. The PHP version on the new AmazonLinux server is 5.3.29, running on httpd.
When I try to access the URL in the new server, the code is currently stopping in system/core/CodeIgniter.php at this line:
$CI = new $class();
I haven't been able to see any relevant error messages in the httpd error log specified in virtual hosts for the app, nor in the default httpd error log. Using the lynx command line client to access the URL simply shows a internal server 500 error, while accessing through a regular browser just shows a blank page.
Any ideas? I know the Code Igniter version is pretty old, circa 2009. But it's compatible with PHP 5.3, which we're running on the new server. This is legacy code and will disappear at some point, so we have no interest in upgrading the PHP or CI level - unless we're forced to due to the upgrade.
The problem turned out to be a database access issue. Specifically, the version of PHP on the new server turned out to not support deprecated calls to php-mysql APIs (e.g. #mysql_pconnect or #mysql_connect)
The solution was to
1) Download the mysql library which supports the legacy calls. In the case of AmazonLinux, this is accomplished as follows:
sudo yum install php-mysql
2) Find where the library was downloaded e.g.
find / -name mysql.so
This may have been shown in the install as well, but that is a way to find it anytime. YMMV, but in my case, the library name was:
/usr/lib64/php-zts/modules/mysql.so
3) Change php.ini (as shown in phpinfo when called from a php page on the httpd/apached server) as follows:
a) change "extension_dir" to show where the mysql.so is installed:
extension_dir = "/usr/lib64/php-zts/modules"
b) Then add the following lines:
extension=mysqli.so
extension=mysql.so
extension=pdo_mysql.so
Reboot apache and you should be good to go.
Note: the specific legacy call not supported, which is part of of the version of CodeIgnitor I'm working with, was this:
return #mysql_pconnect($this->hostname, $this->username, $this-
The php error log showed this error:
PHP Fatal error: Call to undefined function mysql_connect() in xxx.php on line xx
I am trying to learn PHP with mongodb backend, but I could not connect PHP to mongo because of the following error:
fatal error Mongo class undefined
I am using Xampp and netbeans as IDE. I looked it up and got that the drivers are to be installed.
So I downloaded the drivers which is php_mongo-1.4.x-5.5-vc11.dll. I put it in the .../php/ext/folder and edit php.ini placing extention = php_mongo.....dll.
But still when I start my apache it says php_mongo...dll not found althought it is placed correctly. Also it says libsasl.dll not found, which when I looked up, it was in place.
I have mongodb installed and I have correct driver version, so why does it happen?
I followed a few steps from http://caseymorford.com to install the OCI8 extension. The only issue was that the install-path on success was different. So i copied the oci8.so file to the right folder.
After restarting Apache and running some php, i still get the message:
Call to undefined function oci_connect()
Is there some other way to download a complete > PHP5.4 version with a build in oci extension?
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.
I'm working on a project that uses the SQL Server Driver for PHP, and want to upgrade the driver to the new version (2.0), because I need some of the functions that have been implemented there.
I replaced the old .dll in the php/ext directory and restarted the web server. But now I receive the following error:
Fatal error: Call to undefined function sqlsrv_connect() in E:\ProjekteExtern\hades\_apl\classes\sql\sqlsrv.class.php on line 34
The phpinfo() output shows sqlsrv, just like with the previous version.
Does anybody know why I'm getting this error or have any ideas to solve this problem?
For those still having errors with PHP and Microsoft SQL Server using PHP SQL, check the web server's log (Apache, IIS, etc). I have just found out that WampServer x64 is not compatible with PHP SQL Server Driver, so I'm installing the 32-bit version back again.
UPDATE:
for WampServer 2.2, PHP is compiled thread-safe and with VC++ 9.0, so it works using either
php_pdo_sqlsrv_53_ts_vc9.dll
or
php_sqlsrv_53_ts_vc9.dll