Jump to content

[SOLVED] How to run PHP locally?


Maracles

Recommended Posts

I have just downloaded WAMP and wish to test some .php pages before uploading them to my domain, how can this be done? 

 

Currently when I run a .php page locally through the local host the PHP code is not being read and is simply being displayed as text on the page.

 

Surely there is a way to test .php pages without uploading them?

Link to comment
Share on other sites

See, that is how I thought it should work and thats what I had set-up previously.

 

I have since however reinstalled WAMP and things seem to kind of work. It is reading my 'INCLUDE' PHP statements but there is one statement that it is having trouble with.

 

I have a page with tabs set-up, and each of the tabs is set up with the following line of code. Now when I run this on my domain everything works fine, however when I test this locally it it displays the tab but does not run the PHP instead I get a tab followed by this text 'href="index.php">'. Why is it displaying the text and now reading the code?

 

<li><a<? if($page == 'index') print ' class="active"'; ?>  href="index.php"><span>Home</span></a></li>

 

I know this is now a slightly different question from the original one but any ideas?

Link to comment
Share on other sites

 

Argh! Thanks for the advice, that worked perfectly! I've only been learning PHP for a shortwhile and I always used to use <?php as open tags, I have no idea when I started using the 'lazy' short way, I just looked through some of my code and it seems I've been doing it a lot recently :-S.

 

I'll start retraining myself now!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.