Mobile app version of vmapp.org
Login or Join
Goswami781

: PHP not working : Ubuntu I have a problem my test server loads html files fine but when I try to open a file like index.php it says The website encountered an error while retrieving http://localhost/.

@Goswami781

Posted in: #Php #Ubuntu

I have a problem my test server loads html files fine but when I try to open a file like index.php it says The website encountered an error while retrieving localhost/. It may be down for maintenance or configured incorrectly. I have PHP5 installed but I don't see why this isn't working, is it an outdated PHP problem?

[Wed Sep 25 16:53:10 2013] [error] [client 127.0.0.1] PHP Warning: require_once(/home/callum/public_html/Includes/Connection.php): failed to open stream: Permission denied in /home/callum/public_html/index.php on line 8
[Wed Sep 25 16:53:10 2013] [error] [client 127.0.0.1] PHP Fatal error: require_once(): Failed opening required '/home/callum/public_html/Includes/Connection.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/callum/public_html/index.php on line 8
[Wed Sep 25 16:54:51 2013] [error] [client 127.0.0.1] PHP Warning: require_once(/home/callum/public_html/Includes/Connection.php): failed to open stream: Permission denied in /home/callum/public_html/index.php on line 8
[Wed Sep 25 16:54:51 2013] [error] [client 127.0.0.1] PHP Fatal error: require_once(): Failed opening required '/home/callum/public_html/Includes/Connection.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/callum/public_html/index.php on line 8


site config

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /home/callum/public_html/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/callum/public_html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

</VirtualHost>

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Goswami781

2 Comments

Sorted by latest first Latest Oldest Best

 

@Dunderdale272

Instead of this:

require_once(DIR."/Includes/Connection.php");


Use this:

require_once("Includes/Connection.php");

10% popularity Vote Up Vote Down


 

@Chiappetta492

It is a permissions issue. Just change the permissions:

sudo chmod 0644 /home/callum/public_html/Includes/Connection.php


and try again.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme