Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

firstpointdev's avatar

Installed php 5.5

Hi Guys,

I've got an old project running on php 5.5 that we need to run untill we've finished it's replacement. The project is built with Symphony so I'v installed it on forge and installed php 5.5. This all went well the only problem is PDO MYSQL isn't loading and I can't see any reason why. Can anyone point in the direction of some logs or something that would show why this isn't loading?

0 likes
9 replies
bashy's avatar

You have sudo apt install php-mysql installed? Can you check php -i | grep "pdo_mysql" or something?

firstpointdev's avatar

Thanks for replaying. It's installed as if i switch back to php 5.6 it's listed in php_info however when viewing through php 5.5 it isn't listed. I ran the grep command and got:

PHP Warning:  Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0

API Extensions => pdo_mysql,mysql
pdo_mysql
pdo_mysql.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock
firstpointdev's avatar

I'm still struggling haha. Just a quick update that might help somebody give me some advice, if i try to load pdo_mysql in php.ini using extension=pdo_mysql i get the following

NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/blah/pdo_mysql.so' - libmysqlclient.so.18: cannot open shared object file: No such file or directory in Unknown on line 0
firstpointdev's avatar

I have searched for libmysqlclient.so and it doesn't seem to exist

bashy's avatar

@firstpointdev Have you installed the extension for the 5.5 version as well? Have you checked it's enabled in the mods-available/enabled folders?

firstpointdev's avatar

When I compiled 5.5 I did it with:

./configure --with-mysql --with-pdo-mysql

which I believe should install the extensions? This is the first time I have done this though so I may be wrong. Looking at the php.ini 5.5 isn't using mods-available, it loads them from another directory which does contain the mysql.so etc files.

bashy's avatar

@firstpointdev Ah you're compiling from source. Just have a look around, php.ini will have extensions loads in case.

firstpointdev's avatar

I've tried to load the extension in php.ini but get an error saying libmysql cant be found. Be doing some more digging it actually looks like compiling php doesn't make the extensions no idea why, can't see any errors. I've been at this for days and now that i think about it i originally copied the modules from the old server we are moving away from as I noticed php wasn't making them.

Maybe the issue is that php isn't making the modules when i compile it and if i find out why this is happening that will solve the problem?

Thanks for your help, I'm very new to compiling etc.

Sure it'll be a silly mistake I've made, these type of things normally are haha.

firstpointdev's avatar
firstpointdev
OP
Best Answer
Level 8

Got it working! In the end I had to run the below:

./configure --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-fpm-user=www-data --with-fpm-group=www-data --enable-fpm --enable-sockets

Thought it would be useful to put the solution here incase somebody else needs it in the future.

Thanks again for trying to help @bashy

Please or to participate in this conversation.