Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Program Code Errors (http://www.go4expert.com/forums/program-code-errors-t6260/)

idz 8Sep2007 17:08

Program Code Errors
Hi Shabbir :)
How are you?
According to your advice,a few days back I purchased this book- "Beginning PHP5,Apache,MySQL Web Development" by E. Naramore,J.Gerner,Stolz,M.Glass,Yann Le(Wrox Publication).
I have installed WAMP5 version(1.7.3).But after running this program code from page 34-35 of the book I get this output in my Firefox browser(latest version)-

<title>My 1st Program</title>
echo "<h1>I'm a lumberjack.</h1>";
echo "<h2>And I'm okay.</h2>";


I'm a lumberjack."; echo "
And I'm okay.
"; ?>

Why is wrong with the above code? I am getting the 'echo, '; ?' which are part of the syntax of the program, as output!!
Also, the <h1> tag doesn't work!!!Is anything in my configuration wrong?Or is there a error in the above mentioned code?Kindly suggest me what to do to get the correct output..
Also,I have saved the notepad files with .php extension in a folder called "myprog" in the c:\wamp\www\myprog folder.
But when I select the files for running from Firefox browser,it doesn't run.Why i don't know...I have to type http://localhost/programname.php every time I have to run a program in the browser!!
Or,is there a shortcut to the above?When I select File->Open File -> program name the program doesn't run.
I have IIS installed but I have to stop these service manually every time before I start Apache Monitor & wampServer.
Do i also need to start the apache monitor for running PHP? :rolleyes:

I am new to PHP programming so please help me...
Thanks in advance

shabbir 8Sep2007 18:34

Re: Program Code Errors
I am not sure why you are getting error like that but there is something wrong in your code file that is being executed and the one you have posted it here because I get the things as expected.

idz 8Sep2007 20:41

Re: Program Code Errors
But do i need to run the Apache Monitor everytime for running php programs in browser?
Also,I have IIS installed in my Win XP Pro machine..should i uninstall it?

DaWei 8Sep2007 21:48

Re: Program Code Errors
You may have more than one kind of server software installed, just don't have both running at once. I'm not sure what you mean by Apache Monitor. If you want to view the pages you've created in PHP, then you need to have the server running, because that's what interprets the PHP and builds the page.

As Shabbir mentioned, be careful to post your code correctly. Copy and paste it to avoid mistakes.

jwshepherd 9Sep2007 08:45

Re: Program Code Errors
Disabling IIS and setting Apache to auto start will help. Make sure your php.ini file is copied to your windows system32 folder as well.

idz 9Sep2007 11:18

Re: Program Code Errors
But in my PHP Folder I have many php files with various extensions but none exactly with the .ini extension.There is one php configuration settings notepad file,a php Application (CLI) file,
php Application (CGI/Fast CGI) file,php-win(CLI) file,php.ini-dist,php.ini-recommended file and 2 registry files - pws-php5cgi,pws-php5isapi.
...So many files with the name 'php' are there...which one to copy?? :eek:

All times are GMT +5.5. The time now is 10:33.