Scofal Posted November 16, 2009 Share Posted November 16, 2009 I have just started to learn PHP. I went through the motions to activate Apache and PHP on my mac and downloaded and installed mysql. (I also loaded WAMP on a windows machine) I was working on some really basic code, following along the book I'm reading. Last night when the page was loaded in firefox it executed no problem. Tonight... Nothing but a blank page. I really don't think it's the code here it is: <html> <head> <title>Variables</title> </head> <body> <?php $var1 = 10; echo $var1; ?> </body> <html> Can anyone point me in the right direction. I have no idea where to even look for the problem. Also, a simple hello world page worked and is now blank. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/181677-a-real-newbie-question/ Share on other sites More sharing options...
mikesta707 Posted November 16, 2009 Share Posted November 16, 2009 did you start your server? is that page in the htdocs or www folder in your server directory? Quote Link to comment https://forums.phpfreaks.com/topic/181677-a-real-newbie-question/#findComment-958212 Share on other sites More sharing options...
Rommeo Posted November 16, 2009 Share Posted November 16, 2009 if you're using wamp server while skype is running. Try to close skype and re-run wamp server. Keep in mind that both are not working at the same time. it works just if you start wamp server first then skype. Quote Link to comment https://forums.phpfreaks.com/topic/181677-a-real-newbie-question/#findComment-958217 Share on other sites More sharing options...
Etherwood Posted November 16, 2009 Share Posted November 16, 2009 Like mike says, you need to check if PHP is actually running. Quote Link to comment https://forums.phpfreaks.com/topic/181677-a-real-newbie-question/#findComment-958228 Share on other sites More sharing options...
Scofal Posted November 16, 2009 Author Share Posted November 16, 2009 I browsed to local host in the browser and the PHP 5.3 info came up but how do check to see if php is running? It's probably not running. Html pages load fine, only php is coming up blank in firefox and safari just prints the actual source code on the page. I restarted apache using the apachectl start command in terminal but it was already running. Is there a command to restart php? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/181677-a-real-newbie-question/#findComment-958263 Share on other sites More sharing options...
mikesta707 Posted November 16, 2009 Share Posted November 16, 2009 did you put your php page into the htdocs folder? only pages there will be executes Quote Link to comment https://forums.phpfreaks.com/topic/181677-a-real-newbie-question/#findComment-958266 Share on other sites More sharing options...
Scofal Posted November 16, 2009 Author Share Posted November 16, 2009 Yeah I'm using a mac so it's the 'sites' directory. (and the pages did load the previous night) On windows I put it in the WAMP/WWW directory should I find the HTDOC directory? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/181677-a-real-newbie-question/#findComment-958398 Share on other sites More sharing options...
monkeytooth Posted November 16, 2009 Share Posted November 16, 2009 Depending on what version of Apache Server you are running or better yet, what WAMP package your running (which im not familiar with mac based LAMP/WAMP packages) But I am sure it has its similarities in issues even on a mac. Anyway what the point I am tempting to make without getting to off course is. Sometimes like the others have mentioned here already php, doesn't always start. More so, neither does the server. You may think it has started when it hasn't, or it got hung due to a misconfiguration conf file. And despite the packages your working with having an installer to install them all they don't always work as easily as 1, 2, 3.. speaking from my own experiences and frustrations of course. If your going to (L/W)AMP it up, I can give you the name of a really good windows version "Apache2Triad" it may be a bit dated (not by much) but it works almost as easy as 1, 2, 3.. should you follow the initial instructions proper. Unless your setting up on Vista or Win7 then unfortunately you got a little extra post prep work to do but not much. Quote Link to comment https://forums.phpfreaks.com/topic/181677-a-real-newbie-question/#findComment-958448 Share on other sites More sharing options...
Scofal Posted November 16, 2009 Author Share Posted November 16, 2009 Thanks for the advice. Any info on WAMP/MAMP set ups would be excellent. I was so excited to start coding basic things in Php and now I'm just so frustrated. If I can't figure it out tonight I may just re-install Snow Leopard on the mac and try it again. For the PC I saved the php file in the WAMP/www directory but I'll look for the htdocs folder. Maybe that is my problem on my pc. Thanks, Quote Link to comment https://forums.phpfreaks.com/topic/181677-a-real-newbie-question/#findComment-958522 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.