You are viewing our Forum Archives. To view or take place in current topics click here.
Installing php to CPU
Posted:

Installing php to CPUPosted:

99rock99
  • Resident Elite
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
I am having trouble installing php to my computer. I have went to php.net and downloaded the file, I am having troubles with the apache server. Please help. Thanks.
#2. Posted:
-Jordan-
  • TTG Addict
Status: Offline
Joined: Jul 12, 201013Year Member
Posts: 2,684
Reputation Power: 122
Status: Offline
Joined: Jul 12, 201013Year Member
Posts: 2,684
Reputation Power: 122
Is this for use as a development environment or to use the computer as a server?
#3. Posted:
99rock99
  • Resident Elite
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
-Jordan- wrote Is this for use as a development environment or to use the computer as a server?


This would be for web development. I would be uploading the php files to a web hosting server.
#4. Posted:
-Jordan-
  • TTG Addict
Status: Offline
Joined: Jul 12, 201013Year Member
Posts: 2,684
Reputation Power: 122
Status: Offline
Joined: Jul 12, 201013Year Member
Posts: 2,684
Reputation Power: 122
99rock99 wrote
-Jordan- wrote Is this for use as a development environment or to use the computer as a server?


This would be for web development. I would be uploading the php files to a web hosting server.

Then you're easier just installing WAMP. It comes with PHP, MySQL, PHPMyAdmin and Apache built in.

[ Register or Signin to view external links. ]
#5. Posted:
99rock99
  • Resident Elite
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
-Jordan- wrote
99rock99 wrote
-Jordan- wrote Is this for use as a development environment or to use the computer as a server?


This would be for web development. I would be uploading the php files to a web hosting server.

Then you're easier just installing WAMP. It comes with PHP, MySQL, PHPMyAdmin and Apache built in.

[ Register or Signin to view external links. ]


After I install do I need to reinstall php?
#6. Posted:
-Jordan-
  • TTG Addict
Status: Offline
Joined: Jul 12, 201013Year Member
Posts: 2,684
Reputation Power: 122
Status: Offline
Joined: Jul 12, 201013Year Member
Posts: 2,684
Reputation Power: 122
99rock99 wrote
-Jordan- wrote
99rock99 wrote
-Jordan- wrote Is this for use as a development environment or to use the computer as a server?


This would be for web development. I would be uploading the php files to a web hosting server.

Then you're easier just installing WAMP. It comes with PHP, MySQL, PHPMyAdmin and Apache built in.

[ Register or Signin to view external links. ]

After I install do I need to reinstall php?

No. Just install that. It'll sort all the php ect for you.
#7. Posted:
99rock99
  • Resident Elite
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
-Jordan- wrote
99rock99 wrote
-Jordan- wrote
99rock99 wrote
-Jordan- wrote Is this for use as a development environment or to use the computer as a server?


This would be for web development. I would be uploading the php files to a web hosting server.

Then you're easier just installing WAMP. It comes with PHP, MySQL, PHPMyAdmin and Apache built in.

[ Register or Signin to view external links. ]


No. Just install that. It'll sort all the php ect for you.

After I install do I need to reinstall php?


When I install this and I try running my code from the command line it pauses for a second and then prints out the directory again.

Here is the code for now


<?php

$name = ""; // blank string

//echo "Please enter your name"; // prints out in cmd
//$name = trim (fgets (STDIN)); // trim removes spaces before, filegets, standard input
//echo "Hello " . $name; // . in php = + in java

$var = rand(0, 10)// generates random number between 0 and 10
echo "Working";
if ($var == 4){
   echo "4";
}
else {
   echo "Number is not 4. It is" . $var;
}

while ($var > 5){
echo $var;
$var = rand (0,10);
}

?>


I type

php index.php

how come it doesn't work?

Thanks
#8. Posted:
-Jordan-
  • TTG Addict
Status: Offline
Joined: Jul 12, 201013Year Member
Posts: 2,684
Reputation Power: 122
Status: Offline
Joined: Jul 12, 201013Year Member
Posts: 2,684
Reputation Power: 122
99rock99 wrote
-Jordan- wrote
99rock99 wrote
-Jordan- wrote
99rock99 wrote
-Jordan- wrote Is this for use as a development environment or to use the computer as a server?


This would be for web development. I would be uploading the php files to a web hosting server.

Then you're easier just installing WAMP. It comes with PHP, MySQL, PHPMyAdmin and Apache built in.

[ Register or Signin to view external links. ]


No. Just install that. It'll sort all the php ect for you.

After I install do I need to reinstall php?


When I install this and I try running my code from the command line it pauses for a second and then prints out the directory again.

Here is the code for now


<?php

$name = ""; // blank string

//echo "Please enter your name"; // prints out in cmd
//$name = trim (fgets (STDIN)); // trim removes spaces before, filegets, standard input
//echo "Hello " . $name; // . in php = + in java

$var = rand(0, 10)// generates random number between 0 and 10
echo "Working";
if ($var == 4){
   echo "4";
}
else {
   echo "Number is not 4. It is" . $var;
}

while ($var > 5){
echo $var;
$var = rand (0,10);
}

?>


I type

php index.php

how come it doesn't work?

Thanks

You don't run it from the command line. WAMP acts as a local 'server'.


  1. Go to where you installed wamp. Most likely "c:\wamp"
  2. Now go into the "www" directory.
  3. Make a new folder like "tests" or something.
  4. Put you php file inside it.
  5. Turn on the server by clicking the wamp icon in your notifications bar and selecting "Put Online" ( [ Register or Signin to view external links. ] )
  6. Now go to [ Register or Signin to view external links. ] and click on your project folder ( [ Register or Signin to view external links. ] )


If you have any problems, message me on AIM @ JordanCallumA or PM me.
#9. Posted:
99rock99
  • Resident Elite
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
Whenever I try launching wamp I get errors like CLI has stopped working. Apache HTTP Server stopped working and was closed. I also cannot left click the taskbar icon. double left clicking doesn't do anything either. Do I need to uninstall xampp for this to work. What else could be causing these errors. Do I need to re download and reinstall?
#10. Posted:
-Jordan-
  • TTG Addict
Status: Offline
Joined: Jul 12, 201013Year Member
Posts: 2,684
Reputation Power: 122
Status: Offline
Joined: Jul 12, 201013Year Member
Posts: 2,684
Reputation Power: 122
99rock99 wrote Whenever I try launching wamp I get errors like CLI has stopped working. Apache HTTP Server stopped working and was closed. I also cannot left click the taskbar icon. double left clicking doesn't do anything either. Do I need to uninstall xampp for this to work. What else could be causing these errors. Do I need to re download and reinstall?

If you already have xampp then why aren't you just using that?
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.