0

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:

enter image description here

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.

Expedito
  • 7,771
  • 5
  • 30
  • 43
Suhail Gupta
  • 22,386
  • 64
  • 200
  • 328
  • isn't tomcat for JSP? though i believe you can set them side by side by specifying certain rules on the urls.. a quick search showed me this. hopefully this will help you. http://stackoverflow.com/questions/779246/run-a-php-app-using-tomcat – reikyoushin May 24 '13 at 13:01

1 Answers1

1

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.

Rijndael
  • 3,683
  • 2
  • 24
  • 26
  • I might be misunderstanding a concept.But what is the need to start `xampp` ? I am already running `tomcat` from netbeans. – Suhail Gupta May 24 '13 at 14:50