Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hi Larry & Everyone,

 

I'm trying to follow your book and trying to set up the environment etc, but the huge problem I am running into is that my PHP code isn't executing when I load it into the browser and it just displays the source code.  I have scoured around the web and haven't found any solutions to this.  Any thoughts and possible help you guys could offer me?  Apache seems to be running ok and I dont have any errors in my log (at least doesn't look like it)...what could be the problem?  I installed xampp etc.

Link to comment
Share on other sites

 

What folder are you executing the file from, what is the name of the file, and what URL are you using in the browser to access the file?

 

 

Hey Hartley,

 

I'm executing from C:\xampp\htdocs\phptest and just phpinfo.php using <?php phpinfo(); ?>.  I am accessing it using the web browser:

 

http://localhost/phptest/phpinfo.php

 

when I use the web browser, it shows just the source code:  <?php phpinfo(); ?>  

 

I tried changing the file to just be in htdocs and the same result.  So I have no idea what I am doing wrong :(.

 

Also when I access localhost, xampp says that mysql, php etc are active.

Link to comment
Share on other sites

Yea, it's a php file.

 

I went to the php_error_log and got this, not sure if this is what's causing the problem:

 

[06-Feb-2014 22:16:30 Europe/Berlin] PHP Warning:  file_get_contents(lang.tmp): failed to open stream: No such file or directory in C:\xampp\htdocs\xampp\index.php on line 2
Link to comment
Share on other sites

The only possible explanation is your XAMPP isn't installed properly. Or isn't running properly. If you are going though http:// to access your files, there's no other answer. 

Hi Larry,

 

Thanks for writing back to me.  If I am able to access xampp through the localhost address etc and I get the main xampp page is there something missing?  

Link to comment
Share on other sites

 Share

×
×
  • Create New...