Guest winston Posted January 3, 2003 Report Share Posted January 3, 2003 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) Quote Link to comment Share on other sites More sharing options...
fuzzylizard Posted January 3, 2003 Report Share Posted January 3, 2003 Question: have you tried to run the script using apache or this an error that Quanta is displaying? Quote Link to comment Share on other sites More sharing options...
Guest winston Posted January 3, 2003 Report Share Posted January 3, 2003 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) Quote Link to comment Share on other sites More sharing options...
fuzzylizard Posted January 3, 2003 Report Share Posted January 3, 2003 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) Quote Link to comment Share on other sites More sharing options...
Guest winston Posted January 3, 2003 Report Share Posted January 3, 2003 Right I didn't get the source code or error. I tried the script you listed. Mozilla just came up with a blank screen. :?: Quote Link to comment Share on other sites More sharing options...
fuzzylizard Posted January 3, 2003 Report Share Posted January 3, 2003 Hmmm... How did you go about installing both Apache and PHP? Quote Link to comment Share on other sites More sharing options...
Guest winston Posted January 3, 2003 Report Share Posted January 3, 2003 From what I remember they were both installed when I installed the system (show individual packages). :?: Quote Link to comment Share on other sites More sharing options...
fuzzylizard Posted January 3, 2003 Report Share Posted January 3, 2003 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. Quote Link to comment Share on other sites More sharing options...
Guest winston Posted January 3, 2003 Report Share Posted January 3, 2003 No that doesn't do it thats how I had the first script setup, with HTML code around it. Thanks for your help though. :!: Quote Link to comment Share on other sites More sharing options...
richardwest Posted January 4, 2003 Report Share Posted January 4, 2003 I might be completely wrong but are you just opening the file or are you pointing your browser to http://localhost (or whatever)? Is your file in your /var/www/html directory? Quote Link to comment Share on other sites More sharing options...
Guest joehill Posted January 4, 2003 Report Share Posted January 4, 2003 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! Quote Link to comment Share on other sites More sharing options...
johnnyv Posted January 6, 2003 Report Share Posted January 6, 2003 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. Quote Link to comment 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.
Note: Your post will require moderator approval before it will be visible.