0

I've just installed LAMP on my Ubuntu 9.10 machine, and everything works fine except when I copy my PHP files from another computer.

The LAMP guides I've followed also made me create a phpinfo() test file, which works, but when I try to type in e.g. index.php absolutely nothing happens - just a blank page in FireFox. :( The files are in the exact same directory.

I'm thinking it's probably something with permissions and so on, but since I'm new to both PHP and Ubuntu, I'm kind of lost. It's like I can't create a PHP file with my file browser, but only by using the terminal - like when I created the testing.php from the LAMP guide.

kasperwf
  • 277
  • 2
  • 4
  • 16
  • Check Apache error log if there's something usefull. It seems to me there's an error but wasn't displayed. Check error_reporting() function and place it in right place to turn errors on and see what's going on. – dwich Jul 11 '10 at 13:14
  • What 'other computer' are you copying the files from? A windows machine? Are your line endings OK? If you create a simple `` is that OK? – MrWhite Jul 11 '10 at 13:18

2 Answers2

0

Whaddayaknow... I made an error, tried to:

echo "Hello" world

which, even though I'm a PHP noob, I clearly know is wrong.

I think I'll have to figure out how to enable some sort of error reporting, a blank page is clearly not good enough.

kasperwf
  • 277
  • 2
  • 4
  • 16
  • You can enable error reporting by editing the php.ini file (error_reporting = E_ALL). – Anax Jul 11 '10 at 13:19
  • You can also validate the syntax of your PHP script from the command line to identify compilation errors using php -l – Mark Baker Jul 11 '10 at 13:41
0

You mean you have a index.php (copied from another computer) and a test.php (edited by hand, with a call to phpinfo()) in the same apache directory, the second works from your browser and the first doesnt ?

That can be a permission issue, or some compilation error in your php.

About permissions, for files should be readable from the apache server (more precisely, form the user that runs the apache server). You can type chmod a+r index.php.

YOu can also check your apache error logs (location dependent on installation). In any case it's vital to know where the error logs are if your are developing a web site.

leonbloy
  • 73,180
  • 20
  • 142
  • 190