moreno5
Posts: 18
Joined: Sat Oct 19, 2013 9:26 pm

Phptest file now showing

Sun Oct 20, 2013 8:23 pm

Hi Guys,

I have recently installed a new OS on my Pi and have been setting up the system with php5, apache2 and mysql. I have manage to view the "It works" page, but when adding the line of code to be able to view the PHPTEST file it does nothing and I cannot view it when trying to connect via the Pi's IP.

What am I doing wrong?

thanks

moreno5
Posts: 18
Joined: Sat Oct 19, 2013 9:26 pm

Re: Phptest file now showing

Sun Oct 20, 2013 8:27 pm

Sorry, this is the line I am writing;

sudo sh -c 'echo "<?php phpinfo(); ?>" > /var/www/phptest.php'

lazarus78
Posts: 236
Joined: Thu Jul 25, 2013 5:16 pm

Re: Phptest file now showing

Mon Oct 21, 2013 7:51 am

Web pages load the "index" or "default" file as the "home page", so rename your phptest.php to index.php

moreno5
Posts: 18
Joined: Sat Oct 19, 2013 9:26 pm

Re: Phptest file now showing

Mon Oct 21, 2013 8:14 am

Ok, thanks, I will give that a try later and see if it works.

chilinski
Posts: 16
Joined: Mon Sep 16, 2013 8:08 pm

Re: Phptest file now showing

Mon Oct 21, 2013 6:12 pm

You don't have to rename the file. phptest.php is fine. Just put it into your DocumentRoot directory and point your browser to it:

http://raspberrypi_name_or_ip/phptest.php.

If you get a blank page, it means there's a syntax error in the phptest.php file...you won't get an error message, you'll just get a blank page.

Return to “Beginners”