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"); ?>
sounds there wrong configuration, here few things can check:
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.make sure php module listed and uncommented inside of apache's httpd.conf should
loadmodule php5_module "c:/php/php5apache2_2.dll"
in file. searchloadmodule php
, , make sure there no comment (;
) in front of it.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.make sure file has
.php
extension on it, or whichever extension specified in mime definition in point #3, otherwise not executed php.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.inishort_open_tag=on
if have code relies on them).make sure accessing file on webserver using url
http://localhost/file.php
not via local file accessfile://localhost/www/file.php
and lastly check php manual further setup tips.
Comments
Post a Comment