php wrote:rpdom wrote:php wrote:I either open the file in the Terminal or open it directly in the - /var/www/html - with the browser.
Neither of those methods will work as you are just reading the source file. It won't be executed by php.
How can I enable the .php files to load from these folders? It worked in the /var/www/html folder before.
Unless (in your terminal) you run something like "php /var/www/html/index.php" then they won't normally be run through the php engine. You may be able to get a similar effect if you have a "#!/usr/bin/php" as the first line, but they they probably won't be usable via apache.
Loading that path in your browser won't (and never will have worked).
There is a reason that several people said use
http://localhost/index.php, as that will use the network socket that goes via apache rather than talking direct to the filesystem.
php wrote:rpdom wrote:php wrote:Even if I navigate to the files using
http://localhost it does the same thing. Just downloads them to the Downloads folder.
That method, however, should work, if PHP is enabled in the server.
If I do that I get a "
The requested URL - /var/www/html/processorder.php - was not found on this server."
PHP is not working? How do I make sure it's working on my RPi?
When you use that method what's the contents of the downloaded file, make sure you're actually looking at the contents of the file you just downloaded (not the file in /var/www/html or something you downloaded yesterday.
Also when you do that what does a tail on the apache logs show. Normally you should see an entry in the access.log when you request the file via
http://localhost/