I've just setup a basic LAMP server using CentOS 7 and have created 2 PHP files
PHP file 1: index.php
<?php
echo "hello world";
phpinfo();
?>
PHP file 2: database.php
<?php
$conn = mysql_connect('localhost', 'removed_actual_username', 'removed_actual_password') or die('Error connecting to mysql');
mysql_select_db('database1') or die('Database does not exist');
print 'All OK!';
?>
index.php works fine, but database.php does not work.
database.php gives me the following error:
Forbidden
You don't have permission to access /database.php on this server.
The permissions of both files are as follows:
[root@localhost html]# ls -al
total 8
drwxr-xr-x. 2 oshirowanen oshirowanen 41 Sep 15 10:12 .
drwxr-xr-x. 4 root root 31 Sep 14 12:01 ..
-rw-r--r--. 1 oshirowanen oshirowanen 181 Sep 15 10:11 database.php
-rw-r--r--. 1 oshirowanen oshirowanen 43 Sep 15 10:13 index.php
[root@localhost html]#
Any idea what I have done wrong or missed?
UPDATE 1:
The PHP version is 5.4.16