Page 1 of 1

Apache 2.0 & PHP problems

Posted: Tue Dec 17, 2002 2:27 pm
by kurupt4
I have installed RedHat Linux 8.0, it installed Apache 2.0, it syas that the PHP package has been installed, it also is loading the php module when Apache starts, but I am unable to run any php files, I receive the Server Error when I do.

Can someone please help me figure this out.....

Thank you in advance

Leo Zayas

Posted: Tue Dec 17, 2002 2:36 pm
by Johnm
Post the error.
Is is parsing php at all?
Make sure that it is looking in the correct place for the php.ini file.

/usr/lib/php.ini
/usr/local/lib/php.ini
Are common places to put it.



John M

More problems

Posted: Tue Dec 17, 2002 3:28 pm
by kurupt4
Thanks for the reponse John, I don't think it is because it is just ignoring the php tags, how do I know where it is looking for php.ini and others.... I am a newbie to php so I really appreciate your help and suggestions........

Posted: Tue Dec 17, 2002 3:42 pm
by Johnm
First of all, let's find out where it is. On your Linux box enter this at the command line:

Code: Select all

locate php.ini
John M

Posted: Tue Dec 17, 2002 3:45 pm
by kurupt4
okay done, it is at /etc/php.ini

Posted: Tue Dec 17, 2002 3:50 pm
by Johnm
now do this:

Code: Select all

cp /etc/php.ini /usr/local/lib/php.ini
That is the default location on linux as far as I know. Then restart your web server and try it again.
If it works go ahead and remove the php.ini from the /etc/ directory.
If not, try copying it to the /usr/lib/ directory.

Code: Select all

cp /etc/php.ini /usr/local/php.ini
John M

Posted: Tue Dec 17, 2002 3:56 pm
by kurupt4
John,

I copied the file over then restarted Apache, then ran my test script, the browser window was blank and when I went to source view I saw this:

<html>
<head><title>PHP Tests</title>
<body>
<? echo "Hello World"; ?>
</body>
</html>

What's next?....thank you so much

Posted: Wed Dec 18, 2002 4:39 am
by Takuma
Try

Code: Select all

<?php echo "Hello World"; ?>

Posted: Wed Dec 18, 2002 7:30 am
by Johnm
Sorry I left ya like that, I had to go pick up my daughter. You can try just echoing out "Hello World" but if you are seeing the php tags the code is not being parsed. Can you show me the flags you set when you configured Apache?
I am looking for something like this:

Code: Select all

./configure --prefix=/custom/apps/apache2 --enable-module=most --activate-module=src/modules/php4/libphp4.a
John M

Posted: Wed Dec 18, 2002 10:39 am
by kurupt4
that's okay John, no problem, I really appreciate you helping me.

Thank you too Kamuna, putting the php in the tag worked, however I heard you could also use ASP style tags <% %>, how is this done?

right now when I used the <?php echo "Hello World" ?> it worked just fine.

Is there like a conf file that I can change so it will accept <? by itself and <% ?

Thank you so much to both of you

Leo

Posted: Wed Dec 18, 2002 10:43 am
by kurupt4
sorry my sincere apologies that should have been TAKUMA and not the way I spelled it, very sorry....

Posted: Wed Dec 18, 2002 10:52 am
by Johnm
Yes,
In the php.ini file you can change it so that <? ?> is acceptable. Do not forget to "clean up" the old copies of the php.ini file in the directoried where it is not used (/etc/php.ini etc) to avoid later confusion.


Glad things worked out for you.
John M

Posted: Wed Dec 18, 2002 11:04 am
by kurupt4
Thank you again so much John, I have done that and it is working good.... now I must go read and find out how to get it working with mySQL, any ideas or suggestions for good quality stuff on PHP and mySQL would be greatly appreciated.....

You guys are the best!

Posted: Wed Dec 18, 2002 11:10 am
by Johnm
us the : phuse link at the top of the page and search in there. I am certain you will fins plenty of info. Also, I believe that the php.net site has some stuff on it too.



John M

Posted: Wed Dec 18, 2002 12:30 pm
by Takuma
kurupt4 wrote:sorry my sincere apologies that should have been TAKUMA and not the way I spelled it, very sorry....
Hehe, I'm kinda use to that... It isn't a Enlgish name off course, it's Japanese. :D