apache - CodeIgniter 1.72 and PHP 5.3.29 compatible? -
we're upgrading our server infrastructure on amazon , i'm attempting migrate php site based on codeigniter (version 1.7.2) new server has amazonlinux os. previous server ubuntu, running php 5.3.3-1ubuntu9.5 on apache2. php version on new amazonlinux server 5.3.29, running on httpd.
when try access url in new server, code stopping in system/core/codeigniter.php
@ line:
$ci = new $class();
i haven't been able see relevant error messages in httpd error log specified in virtual hosts app, nor in default httpd error log. using lynx command line client access url shows internal server 500 error, while accessing through regular browser shows blank page.
any ideas? know code igniter version pretty old, circa 2009. it's compatible php 5.3, we're running on new server. legacy code , disappear @ point, have no interest in upgrading php or ci level - unless we're forced due upgrade.
the problem turned out database access issue. specifically, version of php on new server turned out not support deprecated calls php-mysql apis (e.g. @mysql_pconnect or @mysql_connect)
the solution
1) download mysql library supports legacy calls. in case of amazonlinux, accomplished follows:
sudo yum install php-mysql
2) find library downloaded e.g.
find / -name mysql.so
this may have been shown in install well, way find anytime. ymmv, in case, library name was:
/usr/lib64/php-zts/modules/mysql.so
3) change php.ini (as shown in phpinfo when called php page on httpd/apached server) follows:
a) change "extension_dir" show mysql.so installed:
extension_dir = "/usr/lib64/php-zts/modules"
b) add following lines:
extension=mysqli.so extension=mysql.so extension=pdo_mysql.so
reboot apache , should go.
note: specific legacy call not supported, part of of version of codeignitor i'm working with, this:
return @mysql_pconnect($this->hostname, $this->username, $this-
the php error log showed error:
php fatal error: call undefined function mysql_connect() in xxx.php on line xx
Comments
Post a Comment