Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 31st Dec 2010, 04:47 AM   #1
.
 
Sumit Menon's Avatar
 
Join Date: 2008
Location: Mumbai, India
Posts: 697
Thanks: 996
Thanked 638 Times in 374 Posts
Default
How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Hey there,

Okay.. I'm trying to learn PHP. So, I tried installing WAMP but it gave some error while trying to run it... Then I tried XAMPP. It installed right and would run without errors.. But, it wouldn't recognize the PHP code on a test page I created. I unistalled XAMPP and installed EasyPHP. But, still the same problem. It wouldn't recognize the php code. The code on the test page is...

Code:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?
print “Hello, world”;
?>
</body>
</html>
Any ideas how I can get it working? I'm running a firewall and I added EasyPHP to the trusted applications.. Still no luck. Any help is appreciated.

Thank You,
Sumit.
Sumit Menon is offline  
Unread 31st Dec 2010, 07:43 AM   #2
Active Warrior
 
Join Date: 2009
Posts: 69
Thanks: 3
Thanked 7 Times in 7 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Why don't you give Apache a chance? It's very easy to install and integrate with PHP, even on Windows. Better yet, why don't you use the webserver where your website is running? It's already configured to run PHP correctly.

leiden is offline  
The Following User Says Thank You to leiden For This Useful Post:
Unread 31st Dec 2010, 10:07 AM   #3
Advanced Warrior
War Room Member
 
Brandon Tanner's Avatar
 
Join Date: 2006
Location: USA
Posts: 1,907
Thanks: 236
Thanked 1,377 Times in 676 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

I use XAMPP and it works great for me. A few things to keep in mind...

1) Is XAMPP turned on? It's not enough just to have it installed - it must be turned on every time you start up your computer. What I did is copy the xampp_start file to my startup folder, so that it starts up automatically whenever I turn on my computer.

2) Are your php files in the C > xampp > htdocs folder?

3) And this is probably a dumb question, but did you name the files with a .php extension? (instead of .html)


Brandon Tanner is offline  
The Following User Says Thank You to Brandon Tanner For This Useful Post:
Unread 31st Dec 2010, 11:57 AM   #4
VIP Warrior
War Room Member
 
SteveJohnson's Avatar
 
Join Date: 2007
Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Most PHP installs are not configured by default to recognize 'short' open tags <? as opposed to the full open tag: <?php

You just learned a valuable lesson - don't use the short open tag if you're going to be distributing what you write. Many hosting environments don't have that option turned on.

The 2nd Amendment, 1789 - The Original Homeland Security.

Gun control means never having to say, "I missed you."
SteveJohnson is offline  
The Following User Says Thank You to SteveJohnson For This Useful Post:
Unread 31st Dec 2010, 12:17 PM   #5
HyperActive Warrior
 
Join Date: 2010
Posts: 192
Thanks: 34
Thanked 27 Times in 23 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Originally Posted by SteveJohnson View Post

Most PHP installs are not configured by default to recognize 'short' open tags <? as opposed to the full open tag: <?php

You just learned a valuable lesson - don't use the short open tag if you're going to be distributing what you write. Many hosting environments don't have that option turned on.
I must be lucky.. I've worked with about 5 or 6 hosts, and they all recognized it.
CrhisD is offline  
Unread 31st Dec 2010, 12:35 PM   #6
VIP Warrior
War Room Member
 
SteveJohnson's Avatar
 
Join Date: 2007
Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Originally Posted by CrhisD View Post

I must be lucky.. I've worked with about 5 or 6 hosts, and they all recognized it.
That's why I said 'many', not 'most'

I've had 3 fixit clients over the last year whose problems were caused by WordPress plugin developers who used short open tags in their plugins.

Regardless, in the case of the OP, if he hasn't configured Apache to recognize the short tags, he won't get any PHP output - probably will see the open/close tags and print lines as html.

The 2nd Amendment, 1789 - The Original Homeland Security.

Gun control means never having to say, "I missed you."
SteveJohnson is offline  
Unread 31st Dec 2010, 02:16 PM   #7
Web Developer
 
Join Date: 2010
Location: Wisconsin
Posts: 322
Thanks: 2
Thanked 80 Times in 74 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Adding on to Steves comment, XAMPP is not configured to use short tags by default.

As another note it is also a standard to use the Full php start tag <?php
<? ?> is really not accepted anymore.

phpbbxpert is offline  
The Following User Says Thank You to phpbbxpert For This Useful Post:
Unread 31st Dec 2010, 02:27 PM   #8
Warrior Member
 
dgently42's Avatar
 
Join Date: 2010
Posts: 20
Thanks: 1
Thanked 4 Times in 4 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

<?php is required.
Other server-side script languages may also use the <? ?> characters to delimit server-side code. Specifying "php" tells Apache (or whatever) that the language within the delimiters is, in fact, php.
dgently42 is offline  
The Following User Says Thank You to dgently42 For This Useful Post:
Unread 1st Jan 2011, 09:36 AM   #9
.
 
Sumit Menon's Avatar
 
Join Date: 2008
Location: Mumbai, India
Posts: 697
Thanks: 996
Thanked 638 Times in 374 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Originally Posted by SteveJohnson View Post

Most PHP installs are not configured by default to recognize 'short' open tags <? as opposed to the full open tag: <?php

You just learned a valuable lesson - don't use the short open tag if you're going to be distributing what you write. Many hosting environments don't have that option turned on.
Yeah... I tried the other way too.. Still no luck. I'm using EasyPHP btw. Not XAMPP... But, thanks anyway.

Originally Posted by Brandon Tanner View Post

I use XAMPP and it works great for me. A few things to keep in mind...

1) Is XAMPP turned on? It's not enough just to have it installed - it must be turned on every time you start up your computer. What I did is copy the xampp_start file to my startup folder, so that it starts up automatically whenever I turn on my computer.

2) Are your php files in the C > xampp > htdocs folder?

3) And this is probably a dumb question, but did you name the files with a .php extension? (instead of .html)
Yes.. Yes.. And Yes... Still couldn't get it working!

Originally Posted by leiden View Post

Why don't you give Apache a chance? It's very easy to install and integrate with PHP, even on Windows. Better yet, why don't you use the webserver where your website is running? It's already configured to run PHP correctly.
Do you know any development environment that directly uploads the scripts to your server? Like in two steps. You save the file and click upload. Cuz doing it via FTP would be quite tedious!
Sumit Menon is offline  
Unread 1st Jan 2011, 12:02 PM   #10
Article Publisher
War Room Member
 
Havenhood's Avatar
 
Join Date: 2009
Location: Out West!
Posts: 140
Thanks: 9
Thanked 18 Times in 18 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

How are you getting to your php file? Are you using your localhost loopback?


I've noticed that the quotes around your print string are not correct. Did this forum format them that way?

--= -Spazzle- =--
Havenhood is offline  
Unread 1st Jan 2011, 01:43 PM   #11
Senior Warrior Member
War Room Member
 
Join Date: 2010
Posts: 1,072
Thanks: 339
Thanked 194 Times in 134 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Install WAMP or XAMPP.
Jake Gray is offline  
Unread 4th Jan 2011, 05:58 AM   #12
Warrior Member
 
Join Date: 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Download Xamp or Wamp server . You can get this software in sourforge.net
In wamp server:
paste your php file in "www" folder.
Then Start the server.
Now enter in browser as "localhost/path_to_file"
For eg:
if you store the file in www/newfolder, then the path to this file is:
localhost/newfolder/filename.php

In Xamp server:
Paste in htdocs folder.
Then follow above steps

blackstar3 is offline  
Unread 4th Jan 2011, 07:48 PM   #13
Warrior Member
 
Join Date: 2011
Posts: 27
Thanks: 1
Thanked 4 Times in 3 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

You can use the <? short tag, but make sure it's enabled in the php.ini file.

Did you get it working yet?

If you're really frustrated, you could always just pay $5 per month and get a shared hosting account that has PHP ready to go.
Senesoft is offline  
Unread 5th Jan 2011, 03:36 AM   #14
Active Warrior
 
Join Date: 2011
Posts: 48
Thanks: 0
Thanked 2 Times in 2 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Install php framework from their site & then write php codes & save it with the extension .php . It will work then.
blogdecor is offline  
Unread 8th Jan 2011, 08:39 PM   #15
Active Warrior
 
Join Date: 2010
Posts: 50
Thanks: 0
Thanked 7 Times in 6 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Originally Posted by blackstar3 View Post

Download Xamp or Wamp server . You can get this software in sourforge.net
In wamp server:
paste your php file in "www" folder.
Then Start the server.
Now enter in browser as "localhost/path_to_file"
For eg:
if you store the file in www/newfolder, then the path to this file is:
localhost/newfolder/filename.php

In Xamp server:
Paste in htdocs folder.
Then follow above steps
Hey!,Me too struggled to run php on my PC.But hadn't got success until I tried this.You can try it and it's working good..Thanks.
Mrewards is offline  
Unread 10th Jan 2011, 09:48 AM   #16
Active Warrior
 
Join Date: 2011
Posts: 47
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

InstalL XAMPP. The instructions on the website are very good and clear. Post here if you have any problems.

msforum01 is offline  
Unread 11th Jan 2011, 11:19 AM   #17
Warrior Member
 
Join Date: 2010
Location: Birmingham, UK
Posts: 19
Thanks: 1
Thanked 3 Times in 3 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Originally Posted by Sumit Menon View Post

Do you know any development environment that directly uploads the scripts to your server? Like in two steps. You save the file and click upload. Cuz doing it via FTP would be quite tedious!
Dreamweaver will do this no probs. You do have to enter your ftp settings when you setup the site but this is a one off, after that you just click the upload button.

In XAMPP are you able to see your phpinfo() page from localhost homepage? If you can see this it means that your php is at least partially working.
Jahnold is offline  
Unread 11th Jan 2011, 12:25 PM   #18
HyperActive Warrior
War Room Member
 
davewebsmith's Avatar
 
Join Date: 2008
Location: London
Posts: 330
Thanks: 48
Thanked 47 Times in 46 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

if you dont come right uninstall xampp and then install vertrigo

VertrigoServ

one stop WAMP environment
  • Apache 2.0.64
  • PHP 5.2.14
  • MySQL 5.0.91
  • SQLite 3.7.3
  • Smarty 2.6.26
  • PhpMyAdmin 2.11.11
  • ZendOptimizer 3.3.3
  • SQLiteManager 1.2.4
used it for years ...

enjoy
davewebsmith

watch this space ...
davewebsmith is offline  
Unread 11th Jan 2011, 12:30 PM   #19
HyperActive Warrior
War Room Member
 
davewebsmith's Avatar
 
Join Date: 2008
Location: London
Posts: 330
Thanks: 48
Thanked 47 Times in 46 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Originally Posted by Jahnold View Post

Dreamweaver will do this no probs. You do have to enter your ftp settings when you setup the site but this is a one off, after that you just click the upload button.

In XAMPP are you able to see your phpinfo() page from localhost homepage? If you can see this it means that your php is at least partially working.
Be cafefully - dreamweaver will sync all files so you can overwrite files that you might not want to ...

I would suggest a stand alone FTP client or using the file manager in CPanel to upload smaller websites. that way you are in full control of what you are uploading and overwriting at all time

ps - it comes from years of experience and tons of overwrites

watch this space ...
davewebsmith is offline  
Unread 11th Jan 2011, 04:02 PM   #20
Nick Temple
War Room Member
 
Join Date: 2005
Location: Louisville, Ky, USA.
Posts: 35
Thanks: 1
Thanked 4 Times in 4 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Not sure what your trying to do, exactly.

If you are developing, try the Nuspher PHP IDE. I believe they have a free trial. It installs PHP and a local webserver, and also works over remote connections. It is absolutely amazing, as it can show you the performance and other aspects of your app.

If you are trying just to run a full stack locally, without doing your own development, WAMP is great.
ntemple is offline  
Unread 11th Jan 2011, 11:30 PM   #21
Advanced Warrior
War Room Member
 
Johnny Slater's Avatar
 
Join Date: 2006
Location: Alabama, USA.
Posts: 878
Thanks: 123
Thanked 475 Times in 182 Posts
Blog Entries: 2
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

You need to be careful when coding php locally on a Windows machine. Windows handles server file paths differently than web servers which almost always run a Linux variation.

If your code deals with server paths you will need to make changes to get the script to run on a web server even though it works perfectly on your local Windows machine.


Johnny Slater is offline  
Unread 12th Jan 2011, 09:19 AM   #22
HyperActive Warrior
 
Join Date: 2010
Posts: 192
Thanks: 34
Thanked 27 Times in 23 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

In the end it might be something simple like naming the file xx.html instead of xx.php
CrhisD is offline  
Unread 15th Feb 2011, 07:26 PM   #23
HyperActive Warrior
War Room Member
 
Tim Brownlaw's Avatar
 
Join Date: 2009
Location: Berwick, Melbourne, Australia
Posts: 156
Thanks: 5
Thanked 47 Times in 28 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Originally Posted by Sumit Menon View Post

Hey there,

Okay.. I'm trying to learn PHP. So, I tried installing WAMP but it gave some error while trying to run it... Then I tried XAMPP. It installed right and would run without errors.. But, it wouldn't recognize the PHP code on a test page I created. I unistalled XAMPP and installed EasyPHP. But, still the same problem. It wouldn't recognize the php code. The code on the test page is...
......
......
Thank You,
Sumit.
Ok first things first.. if something don't work, there is a reason why!
If you end up banging your head against a brick wall, changing the wall won't necessarily help you any.

When you get any errors, it's a very good idea to let us know what the error(s) are. Copy and paste them in here. Without them we are running blind and can't really help.

Anyway, It sounds like you did get XAMMP to run if you saw the page being served but with the PHP not working and then you switched to easyphp.

Go back to what you had working... Although I teach installing WAMP , XAMMP is the same beast with slight differences.

If you are going to learn how to program, you are going to come across a whole lot of things that "don't work". The fun part is working out why and fixing them.

It's good you came in here to ask for help, but please, be a little more descriptive when it comes to "it doesn't work". You can go to Google and search for "it doesn't work" but you aint going to get much luck with that either.

So are you still having issues?

Cheers
Tim

Great Success is built from many little successes!

http://www.timbrownlaw.com - My Wee Part of the World.

http://www.LookingOverMyShoulder.com
Tim Brownlaw is offline  
Unread 15th Feb 2011, 11:06 PM   #24
Active Warrior
 
Join Date: 2011
Posts: 31
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Its very Simple !!
Step 1 : Download WAMP server.
Step 2 : Before installing WAMP server Remove IIS from the windows
Step 3 : Install WAMP give the username as root and password blank
Step 4 : By default install wamp in C:\
Step 5 : Open the C:\wamp\www
Step 6 : Create a new file using any editor remove all the html tags
Step 6 : Type this in the file
<?php echo "Php Code is Running in My Pc"; ?>
Step 7 : Save the file with extension.php
Step 8 : Open Local host either you can type in browser or you can click the WAMP icon near Time display.
Step 9 : In that you will have list Localhost,PHP my admin Select localhost
Step 10 : It display folders in the C:\wamp\www\
Step 11 : Select the file you need to Run
Step 12 : Thats my friends...
tirupati is offline  
Unread 16th Feb 2011, 12:35 AM   #25
Warrior Member
 
Join Date: 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

You need to install wamp or xampp application. This applications contains php, mysql, apache and some other plugins that you need in order to run php in your pc.

gustoads is offline  
Unread 16th Feb 2011, 10:50 AM   #26
Warrior Member
War Room Member
 
bobbylee's Avatar
 
Join Date: 2010
Posts: 28
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

WAMP and XAMPP are the best for automated installation and i never get any problem using them on localhost
bobbylee is offline  
Unread 17th Feb 2011, 09:15 AM   #27
Active Warrior
 
myvps's Avatar
 
Join Date: 2011
Posts: 61
Thanks: 2
Thanked 0 Times in 0 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

are you use WampServer?
myvps is offline  
Unread 17th Feb 2011, 05:16 PM   #28
Active Warrior
 
Join Date: 2010
Location: India
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Hi,
You have to follow some steps
Download and install PHP
On the following window, leave the SMTP defaults
On the next window, make sure that the radio button "Display all errors warnings and notices" is clicked.
In Windows open "My Computer", and browse your way to the folder "C:ServerApache2conf".

godwinsam is offline  
Unread 18th Feb 2011, 12:31 AM   #29
Warrior Member
 
Join Date: 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

XAMPP will be the best for you problem.

goldcraftstudio is offline  
Unread 18th Feb 2011, 04:40 AM   #30
The Grand Master
 
Join Date: 2011
Posts: 39
Thanks: 1
Thanked 4 Times in 4 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Originally Posted by Sumit Menon View Post

Hey there,

Okay.. I'm trying to learn PHP. So, I tried installing WAMP but it gave some error while trying to run it... Then I tried XAMPP. It installed right and would run without errors.. But, it wouldn't recognize the PHP code on a test page I created. I unistalled XAMPP and installed EasyPHP. But, still the same problem. It wouldn't recognize the php code. The code on the test page is...

Code:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?
print “Hello, world”;
?>
</body>
</html>
Any ideas how I can get it working? I'm running a firewall and I added EasyPHP to the trusted applications.. Still no luck. Any help is appreciated.

Thank You,
Sumit.
Try to restart wamp Every time you made a change on your coding and also if you are using skype at the same time try to turn off your skype, skype and wamp dont well mix together.

pc101seo is offline  
Unread 18th Feb 2011, 06:47 AM   #31
WebNinja
 
jminkler's Avatar
 
Join Date: 2010
Location: Atlanta GA
Posts: 444
Thanks: 19
Thanked 54 Times in 34 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Here's another idea, one I like to do ...

Install VMPlayer, with a Ubuntu 10.04 OS.

Developing PHP on Windows can be a real challenge (and I'm a professional)


in ubuntu it's 2 easy commands to set it all up


That being said ...

If you are getting Errors, what are they?? Makes it easier for us to tell you exactly what your problem is.
jminkler is offline  
Unread 18th Feb 2011, 06:50 AM   #32
WebNinja
 
jminkler's Avatar
 
Join Date: 2010
Location: Atlanta GA
Posts: 444
Thanks: 19
Thanked 54 Times in 34 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Originally Posted by leiden View Post

Why don't you give Apache a chance? It's very easy to install and integrate with PHP, even on Windows. Better yet, why don't you use the webserver where your website is running? It's already configured to run PHP correctly.

Testing your code on your home PC is a VERY good idea. This is how it really should be done. Once your happy with the owrk you can then upload it and over write all your files. Or better yet, you can setup SVN.
jminkler is offline  
Unread 29th Mar 2011, 12:59 AM   #33
Active Warrior
 
Join Date: 2011
Location: Philippines
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

I uses WAMP, Maybe you just forget to uncheck the IIS in windows after installing Wamp,
the file that you are doing need to be place on (c:\wamp\www\) and be sure that file you are saving has an .php extension (sample.php)
how to browse that file: access "http://localhost/" there you will see wamp home page
access "http://localhost/Folder/sample.php"
Folder is the sample name of folder that is sample page located.
leahpot is offline  
Unread 29th Mar 2011, 01:37 AM   #34
VIP Warrior
War Room Member
 
Join Date: 2010
Posts: 1,756
Thanks: 51
Thanked 114 Times in 112 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

First install WAMP , XAMPP or MAMP on your computer so your computer will be your local server .
kaytav is offline  
Unread 31st Mar 2011, 09:27 PM   #35
Advanced Warrior
 
hireava's Avatar
 
Join Date: 2010
Posts: 612
Thanks: 0
Thanked 32 Times in 32 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

get your windows installer here:
PHP: Installation on Windows systems - Manual
there's instructions there as well.

hireava is offline  
Unread 1st Apr 2011, 01:47 AM   #36
Success Warrior
War Room Member
 
Adriaan's Avatar
 
Join Date: 2005
Location: 127.0.0.1
Posts: 77
Thanks: 55
Thanked 21 Times in 14 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Maybe you should look at the path in your web browser, with XAMPP, it has to be on the localhost path, like: "http://localhost/test.html"

Further reading - I got the following on the XAMPP site:
The link is: apache friends - xampp for windows

The main directory for all WWW documents is xampphtdocs. If you put a file "test.html" in this directory, you can access it with the URI "http://localhost/test.html".

And "test.php"? Just use "http://localhost/test.php". A simple testscript can be:
PHP Code:
<?php
    
echo 'Hallo world';
?>
A new subdirectory for your web? Just make a new directory (e.g. "new") inside the directory "xampphtdocs" (best without whitespaces and only ASCII), create a test file in this directory and access it with "http://localhost/new/test.php".
Hope this helps.

Get good stuff at adriaanlouw.com. The others do.
Adriaan is offline  
Unread 1st Apr 2011, 04:09 AM   #37
Active Warrior
War Room Member
 
Join Date: 2011
Location: Nelson, New Zealand
Posts: 60
Thanks: 17
Thanked 9 Times in 9 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

I'm really enjoying having my whole web dev environment on a USB stick. Well all except for Photoshop (Allthough you can get Portable Gimp). The advantage is that I can use it on any Windows PC.

I'm using portable versions of XAMPP, Notepad++, Heidi SQL, Filezilla .. you can get them all from PortableApps.com - Portable software for USB, portable and cloud drives
DominicF is offline  
Unread 12th May 2011, 10:25 AM   #38
Toolman Warrior
 
hilmymo's Avatar
 
Join Date: 2007
Location: Mud Estuary
Posts: 38
Thanks: 0
Thanked 6 Times in 6 Posts
Lightbulb
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

I've been using XAMPP, WAMP, EasyPHP but fall in love with Vertrigoserv now.

Had problems in the past running Drupal and many other scripts but Vertrigo made me a very happy man now .

You may want to try it out..

Imagine a carpenter goes to work without hammer and his toolbox? Yes, he's simply doomed for the day. Similarly, successful internet marketers must have their tools too!

I keep lots of free smart tools you can use immediately. Visit: http://y.klikr.info/tools to get your dose today.
hilmymo is offline  
Unread 12th May 2011, 10:39 AM   #39
Active Warrior
 
Join Date: 2010
Posts: 51
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

@hilmymo Thanks of the suggestion of Vertrigoserv. Looks good.
groceryalerts is offline  
Unread 25th May 2011, 06:55 AM   #40
Warrior Member
 
Join Date: 2011
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

I prefer WAMP very easy to use, maybe because I am use to it.But when I am still a begginer,I don't have any problem installing and using it.
kinselatos is offline  
Unread 25th May 2011, 07:38 AM   #41
Warrior Member
 
Join Date: 2011
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

XAMPP work great for me...don't know what may be the problem with yours.

altan is offline  
Unread 25th May 2011, 12:43 PM   #42
Warrior Member
War Room Member
 
Join Date: 2010
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

have u turned on the wamp or xamp? have u put that file and name it *.php to the html or htdoc folder? if u have there's nothing wrong with it O.O
Heimdalx is offline  
Unread 25th May 2011, 02:32 PM   #43
Active Warrior
War Room Member
 
Join Date: 2011
Posts: 63
Thanks: 4
Thanked 7 Times in 5 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

I agree with jminkler. Setup a development virtual machine with VMware Player and Ubuntu Server. When installing Ubuntu all you need to do is select the LAMP option. This is how I do my PHP development.

Then install webmin so that you can configure FTP access to the server or you could use the built in file manager in webmin to transfer the files.

Free article directory for publishers to download. Free article submission with fast approval times. Submit free articles with back links that are Do follow.
ToneUK is offline  
Unread 25th May 2011, 07:56 PM   #44
Active Warrior
 
Join Date: 2011
Location: Philippines
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Originally Posted by Sumit Menon View Post

Hey there,

Okay.. I'm trying to learn PHP. So, I tried installing WAMP but it gave some error while trying to run it... Then I tried XAMPP. It installed right and would run without errors.. But, it wouldn't recognize the PHP code on a test page I created. I unistalled XAMPP and installed EasyPHP. But, still the same problem. It wouldn't recognize the php code. The code on the test page is...

Code:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?
print “Hello, world”;
?>
</body>
</html>
Any ideas how I can get it working? I'm running a firewall and I added EasyPHP to the trusted applications.. Still no luck. Any help is appreciated.

Thank You,
Sumit.
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php
print “Hello, world”;
?>
</body>
</html>

and then, you must save the file to sample.php
try to install the wamp again and then try to run the php file. Hope it will help you fix your problem
leahpot is offline  
Unread 27th May 2011, 04:02 AM   #45
Warrior Member
 
smear's Avatar
 
Join Date: 2011
Posts: 22
Thanks: 0
Thanked 3 Times in 3 Posts
Default
Re: How do I run PHP on my PC?
Share on: 
fb share twitter share gplus share more share

Multiple options are there for you as you required three things editor for php , MYSQL server and Apache server on your machine but if you go for XAMP and WAMP then the file to be save are at different places to keep otherwise errors occured,.
smear is offline  
Closed Thread


Bookmarks

Tags
php, run


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 05:51 AM.