I have a website that works without problems in WAMP.
Recently I moved to Ubuntu, so I installed LAMP and all looks fine:
localhost in browser shows the Apache2 Ubuntu Default Page.
Created an info.php file with the content:
<?php phpinfo(); ?>
Accessing the file with
http://localhost/info.php in the browser works and displays the php info.
But trying to access my website with
http://localhost/index.php doesn't load the website. I have put all required files in the
var/www/html folder (where the info.php file also is and works).
Is there anything else I have to do to be able to load my website?
/etc/apache2/mods-enabled/dir.conf has the below content:
<IfModule mod_dir.c> DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm </IfModule> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
ls -la /var/www/html/in* will list 3 files I have:
-rw-r--r-- 1 root root 10918 Jul 21 19:18 /var/www/html/index.html -rwxrwxrwx 1 mihail-cosmin mihail-cosmin 3931 Apr 26 2017 /var/www/html/index.php -rw-r--r-- 1 root root 20 Jul 21 20:55 /var/www/html/info.php
info.php work, they belong to user and group root.
index.php which doesn't work, belongs to my user and group
I have set the user and group in etc/apache2/envvars but it still doesn't work:
export APACHE_RUN_USER=mihail-cosmin export APACHE_RUN_GROUP=mihail-cosmin
I realized that on Windows I was using an older version of PHP, more exactly: PHP 5.6. I went back on windows and changed the version in WAMP to a newer one, and my website stopped working there also, obviously.
On Ubuntu I installed the older version 5.6 and changed it for Apache also:
sudo a2enmod php5.6 Considering dependency mpm_prefork for php5.6: Considering conflict mpm_event for mpm_prefork: Considering conflict mpm_worker for mpm_prefork: Module mpm_prefork already enabled Considering conflict php5 for php5.6: Enabling module php5.6. To activate the new configuration, you need to run: systemctl restart apache2
But still my website doesn't work.