Reputation: 23256
PHP doesn't get parsed when I try to run the PHP page. I am using NetBeans and running Apache Tomcat as the server. I have defined the interpreter for PHP which is shown in the following snapshot:
If I try to run the PHP page from within the IDE (by using the default shift+F6), it runs, but with a URL file:///C:/Users/user/AppData/Local/Temp/php_1.php11992.html
for a file named php_1.php
. But when I try to test the URL localhost:8081/app/php_1.php
, the PHP in the page isn't parsed, and I see only the HTML getting parsed.
What could be the reason for this? What do I do to parse PHP directly ?
Note: I have installed XAMPP
, and the path I give in the above snapshot is of the PHP interpreter that comes packed with the XAMPP package.
Upvotes: 0
Views: 167
Reputation: 3753
Ensure that the tomcat webserver is stopped and the XAMPP server running, since there could be a conflict (of ports, URIs etc).
If XAMPP is running and it still doesn't work, you can try the following:
Ensure the webserver has the type set in conf.d:
AddType application/x-httpd-php .php .php5 .phtml
Also, if you are using short tags make sure it is enabled in php.ini
Make sure mod_php is enabled in XAMPP (should be by default). You can do this by navigating to httpd.exe in XAMPP and typing httpd -M which will list currently used modules.
Upvotes: 1