Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-18-2003, 11:31 PM
|
#1
|
LQ Newbie
Registered: Jul 2002
Location: Chicago
Distribution: RH9
Posts: 24
Rep:
|
Apache 2.0 and PHP
This is a newbie question :-)
I am installing Apache 2.0 with PHP.
I am having problems and have a strange issue the following works:
<? phpinfo(); ?>
but the following does not work. the source code appears on the page as
if it is not being processed.
<?php phpinfo(); ?>
I read in a newsgroup to try the second. I am wondering if this could some how be part of my problem. any ideas why the second line does not work.
|
|
|
08-19-2003, 01:21 AM
|
#2
|
Member
Registered: Aug 2003
Location: Los Angeles
Distribution: gentoo
Posts: 52
Rep:
|
Mysterious. The opposite has always been true for me where only the long form works. Check the config files of both apache and php.
|
|
|
08-19-2003, 06:15 AM
|
#3
|
LQ Newbie
Registered: Jul 2002
Location: Chicago
Distribution: RH9
Posts: 24
Original Poster
Rep:
|
Quote:
Check the config files of both apache and php
|
What do i look for ? Apache is set up to look for files that end in php and what should the php.ini file contain ?
Thanks
|
|
|
08-19-2003, 06:45 AM
|
#4
|
Member
Registered: Dec 2002
Location: Virginia, USA
Posts: 131
Rep:
|
You may also try re-formatting your code.. to be on 3 lines instead of 1.
ie:
<?php
phpinfo();
?>
I'm not sure why, but I've seen this actually work when your problem was occuring on one of my machines.
|
|
|
08-19-2003, 07:20 AM
|
#5
|
Member
Registered: Jun 2003
Location: Brussels, Belgium
Distribution: Ubuntu 6.10
Posts: 139
Rep:
|
Hello,
What is the output of this <?php phpinfo(); ?> on your computer?
Could you give more details (error message for instance)?
Vincent
|
|
|
08-19-2003, 07:47 AM
|
#6
|
LQ Newbie
Registered: Jul 2002
Location: Chicago
Distribution: RH9
Posts: 24
Original Poster
Rep:
|
As i mentioned above, the only thing that appears on the page within the browser is the php code. It is as if apache didnt process the code as php, but rather displayed the source as if it was contained within an html page.
Also, I did try breaking the source across three lines.
|
|
|
08-19-2003, 01:01 PM
|
#7
|
Member
Registered: Aug 2003
Location: Los Angeles
Distribution: gentoo
Posts: 52
Rep:
|
this seems to be the relevant section of php.ini
; Allow the <? tag. Otherwise, only <?php and <script> tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag = On
|
|
|
08-19-2003, 01:33 PM
|
#8
|
LQ Newbie
Registered: Jul 2002
Location: Chicago
Distribution: RH9
Posts: 24
Original Poster
Rep:
|
After looking at the ini file and tweaking the code, It works. I think my problem was that i put a space netween the ? and the PHP portion of the tag. At least that was the last thing I fixed and now the pages works correctly. :-)
Thanks !!!!!
|
|
|
All times are GMT -5. The time now is 02:43 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|