Jump to content

PHP help please


Guest winston
 Share

Recommended Posts

Guest winston

Hi all I'm a linux newbie. I have Apache up and running it says that the PHP/4.2.3 is installed but when I go into Quanta and try making a sample php script:

<body bgcolor="white">

<strong>An Example of PHP ub Action</strong>

 

<?php echo "the Current Date and Time is: <br?";

echo date ("g:i A l, F j Y.");?>

 

and I go into tools Syntax check the error it gives me is:

 

unknown element <?php>. I'm not sure what to check.

 

Thanks in advance. 8)

Link to comment
Share on other sites

Guest winston

Ok from the original message that was in Quanta preview mode. Went back and tried to open it in Mozilla all I got was the text in the script:

 

An Example of PHP in Action// g = the hour, in 12 hour format //i = minutes //A = print AM or PM, depending... // l = print the day of the week // F = print the month // j = print the day of the month // Y = print the year - all four digits.

 

 

thanks

8)

Link to comment
Share on other sites

But you didn't get the source code though, right? Or some kind of error message?

 

try doing a small script that contains only this:

 

<?php

phpinfo();

?>

 

This should give you a read out of the php environment on your computer.

 

The screen should look something like this: http://www.fuzzylizard.com/info.php

 

If it does, then php is working fine on your system and the error is with your code. (someone else will have to help you with that)

Link to comment
Share on other sites

Okay, try putting some html formatting around the above php script.

 

eg.

 

<html>

<head>

 

 

</head>

<body>

 

 

php script

 

</body>

 

This may make some difference, I am not sure.

 

If that doesn't work, the only advise that I can give you is to uninstall the apache and the php rpms and to do the install yourself. The easiest way is to visit this website:

 

www.apachetoolbox.com

 

and download their script and use it to do the install. Then at least the environment will be setup correctly.

Link to comment
Share on other sites

Guest joehill

I am sure you have already checked this, but just in case, Apache has to be configured to use the PHP module, this is done in your Apache config file.

 

Sorry if I am stating the obvious.

 

Cheers!

Link to comment
Share on other sites

Are you naming your scripts with the .php extension or .html?

Are your scripts in the /var/www/html/ directory?

 

If you installed apache with mod_php it should work, no need to need to edit the apache conf file.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
 Share

×
×
  • Create New...