Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/181677-a-real-newbie-question/
Share on other sites

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.

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.

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,

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.