I’m unfortunately having to install php 5.3.29, Apache and MySQL on Ubuntu 14.04, its proving to be much more difficult that I expected to get them working together.
I’ve tried folllowing this thread and got php 5.3.29 installed.
$ php -v
PHP 5.3.29 (cli) (built: Jun 16 2020 04:00:04)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies
I got Apache installed:
$ apache2 -v
Server version: Apache/2.4.7 (Ubuntu)
Server built: Apr 3 2019 18:04:25
Also got MySQL installed:
$ mysql --version
mysql Ver 14.14 Distrib 5.5.62, for debian-linux-gnu (x86_64) using readline 6.3
It looks like these are all installed as expected but when I create a phpinfo()
script and look at the page it correctly shows the version of php
but has no details for MySQL
.
When trying to access a page that uses mysql
I get the error Fatal error: Call to undefined function mysql_connect()
It seems like Apache
doesn’t see MySQL
for some reason but it does appear to be loading the module.
This is what I see when restarting apache:
* Restarting web server apache2 [Thu Jun 18 05:31:41.808127 2020] [so:warn] [pid 121446] AH01574: module php5_module is already loaded, skipping
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
What do I need to do to get Apache to ‘see’ mysql?
2
Answers
I ended up reinstalling Ubuntu 14.04, apache, mysql and php from scratch, not sure what the problem was but after reinstalling it seems to have resolved the problem. I now have a new problem, so I might need post a new question,
You have to check if the mysql extension is installed in php.
then you should get a list of all php packages. Check if there is something with mysql / mysqli. If not you have to install the mysql / PDO package.
You use an extreme old PHP version which is not maintained anymore. So you should really upgrade and use a newer one. Then you should be able to connect with your php script to the database.