apache - PHP code is not being executed, instead code shows on the page -


i'm trying execute php code on project (using dreamweaver) code isn't being run.

when check source code, php code appears html tags (i can see in source code). apache running (i'm working xampp), php pages being opened php code isn't being executed.

does have suggestion happening?

note: file named filename.php

edit: code..:

<? include_once("/code/configs.php"); ?> 

the print

sounds there wrong configuration, here few things can check:

  1. make sure php installed , running correctly. may sound silly, never know. easy way check run php -v command line , see if returns version information or errors.

  2. make sure php module listed and uncommented inside of apache's httpd.conf should loadmodule php5_module "c:/php/php5apache2_2.dll" in file. search loadmodule php, , make sure there no comment (;) in front of it.

  3. make sure apache's httpd.conf file has php mime type in it. should addtype application/x-httpd-php .php. tells apache run .php files php. search addtype, , make sure there entry php, and uncommented.

  4. make sure file has .php extension on it, or whichever extension specified in mime definition in point #3, otherwise not executed php.

  5. make sure not using short tags in php file (<?), these not enabled on servers default , use discouraged. use <?php instead (or enable short tags in php.ini short_open_tag=on if have code relies on them).

  6. make sure accessing file on webserver using url http://localhost/file.php not via local file access file://localhost/www/file.php

and lastly check php manual further setup tips.


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -