0

I can execute PHP code fine if I name the file *.php and load it in Chromium through the localhost address.

If I try to insert PHP inside a file named *.html, the PHP no longer executes.

Code: http://pastebin.com/LgCzMs02

Output: http://imgur.com/0CO5S

2 Answers 2

2

Unless you update your Apache configuration for the PHP handler to include the html extension, the extension needs to be php.

Sign up to request clarification or add additional context in comments.

4 Comments

I do not advise changing your configuration. I'd simply change the file to test.php
But I'm trying to get an HTML page to do Postgres queries through PHP and display the result, as detailed in my source code. Shouldn't it thus be an HTML file?
file names and extensions are meaningless.
Okay so I'll roll with .php now as the file extension. I'm trying to find some debug output or an interpreter of some kind where I can debug my PHP postgres queries because there's no output to the screen.
0

program that have includes with php file should have the extension of *.php unless you will redirect your index.html to a *.php page during loading.

2 Comments

Interesting. Any tips on debugging my PHP code since nothing is appearing on the page I'm assuming there's an error somewhere. I haven't had any luck finding the PHP interpreter, if there even is one.
yups..if php errors would not appear... go to php/etc/php.ini or find the php.ini in your apache/etc folder..open the php.ini and fid the display_errors = Off and change the value to On

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.