I had PHP 5.3 working on an old server that my company uses. I have PHP 5.5 working on my AWS server. Both of the servers are Ubuntu. My application is working fine on my AWS server. But when I migrate it to that old server, it stops working and keep telling me there is a database connection problem. Now I double-checked several times that the login is not a problem. The error log is saying PHP Warning: mysqli::mysqli(): [2002] Connection refused
. I checked the configuration. It seems like the problem is in the version since I write the application with mysqli
.
Following the step of this question and this page, I tried to upgrade my PHP version to 5.5. But it did not work as the info.php
page still stays the same. So I thought maybe I just remove the apache2 server and start all over by issuing this command:
apt-get remove apache2
.
But after I did that, PHP just stops working. Whenever I try to open a php file in the browser, it automatically downloads it. Now I am kind of lost on where I should go next. Should I try to remove apache2 entirely and then re-install it from the beginning? I installed the apache2 server in the beginning. The server was quite old.
Btw I checked the apache2 conf setting and make sure the following is correct: Options Indexes FollowSymLinks AllowOverride All Require all granted