0

I'm trying to load a website I've development and transferred from windows to ubuntu. I've installed apache2/php5/mysql and I've confirmed that it works by using the default index.html file displaying something like "It Works!". I've also created arbitrary folder containing some php file that I've run in firefox and it was displayed. But when I try to run my projects index.php I get a blank screen. I've consulted mirc about this and they say that it has to do with file permission. I've chcked the file permission on my index.php file and it is owner : rw r , group : r, others : read-only and execute is unchecked.

What am I doing wrong?

1 Answer 1

0

Maybe PHP is generating errors and it isn't displaying them. Apparently, this is the default behaviour.

Try checking the log for errors: tail /var/log/apache2/error.log

Change php.ini to make the errors appear in your browser 1- Open the file /etc/php5/apache2/php.ini (or whatever is your php.ini) in your favorite text editor

2- Search for display_errors

3- Set it to On

4- Restart apache

Next time your try to run a php script it will output the errors.

It can also be a problem with error_reporting. Placing error_reporting(E_ALL); in the beggining of your script will make sure (if display_errors = On) that all kinds of errors will get displayed.

2
  • I went to error.log and I get lots of error when it comes to pathing e.g [Thu Nov 22 02:27:27 2012] [error] [client 127.0.0.1] PHP Warning: include_once(): Failed opening 'model/member_db.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/index.php on line 7 How do I prevent this problem? Nov 22, 2012 at 7:24
  • you have to correct your code. Does this file 'model/member_db.php' exist? Nov 22, 2012 at 14:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .