LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 03-18-2003, 05:49 PM   #1
teded34
LQ Newbie
 
Registered: Feb 2003
Posts: 11

Rep: Reputation: 0
Question php problem


I can not get php to run correctly on redhat 8, I have changed the php.ini file to accept <? as well as <?php, so the short end version works when I do a phpinfo() but when I do the following it does not.
<?
echo "WELCOME";
>?

save it as test.php and then I just get the above exactly as seen not just welcome on the screen.

any ideas.....

Another thing is when I want to edit a php file it has no association to anything, should it not all ready have one and how do you associate it properly in redhat 8.

I am starting to thing I should have used the previous version of redhat.
 
Old 03-18-2003, 07:11 PM   #2
wdingus
Member
 
Registered: Aug 2001
Location: Kingsport, TN
Distribution: RHEL & FC
Posts: 267

Rep: Reputation: 30
Is all of PHP installed?

# rpm -qa | grep -i php
php-pgsql-4.2.2-8.0.5
php-imap-4.2.2-8.0.5
php-mysql-4.2.2-8.0.5
asp2php-gtk-0.76.2-3
php-ldap-4.2.2-8.0.5
php-manual-4.2.2-8.0.5
php-snmp-4.2.2-8.0.5
php-devel-4.2.2-8.0.5
php-4.2.2-8.0.5
asp2php-0.76.2-3
php-odbc-4.2.2-8.0.5

And is it configured into Apache?
# grep -i php /etc/httpd/conf.d/*
/etc/httpd/conf.d/php.conf:# PHP is an HTML-embedded scripting language which attempts to make it
/etc/httpd/conf.d/php.conf:LoadModule php4_module modules/libphp4.so
/etc/httpd/conf.d/php.conf:# Cause the PHP interpreter handle files with a .php extension.
/etc/httpd/conf.d/php.conf:<Files *.php>
/etc/httpd/conf.d/php.conf: SetOutputFilter PHP
/etc/httpd/conf.d/php.conf: SetInputFilter PHP
/etc/httpd/conf.d/php.conf:# Add index.php to the list of files that will be served as directory
/etc/httpd/conf.d/php.confirectoryIndex index.php
/etc/httpd/conf.d/ssl.conf:<Files ~ "\.(cgi|shtml|phtml|php3?)$">

There are basically no problems with PHP and Apache on RedHat 8. At the very least not with a simple "hello world" type program. Something isn't installed or enabled or something.. Stock if you install apache and php on RH8 it should just work, it will be configured as part of the install.
 
Old 03-19-2003, 10:21 AM   #3
teded34
LQ Newbie
 
Registered: Feb 2003
Posts: 11

Original Poster
Rep: Reputation: 0
# rpm -qa | grep -i php
php-pgsql-4.2.2-8.0.5
php-ldap-4.2.2-8.0.5
asp2php-0.76.2-3
asp2php-gtk-0.76.2-3
php-dbg-base-2.10-4
php-4.2.2-8.0.5
php-imap-4.2.2-8.0.5
php-devel-4.2.2-8.0.5

grep -i php /etc/httpd/conf.d/*
/etc/httpd/conf.d/php.conf:# PHP is an HTML-embedded scripting language which attempts to make it
/etc/httpd/conf.d/php.conf:LoadModule php4_module modules/libphp4.so
/etc/httpd/conf.d/php.conf:# Cause the PHP interpreter handle files with a .php
extension.
/etc/httpd/conf.d/php.conf:<Files *.php>
/etc/httpd/conf.d/php.conf: SetOutputFilter PHP
/etc/httpd/conf.d/php.conf: SetInputFilter PHP
/etc/httpd/conf.d/php.conf:# Add index.php to the list of files that will be served as directory
/etc/httpd/conf.d/php.confirectoryIndex index.php
/etc/httpd/conf.d/ssl.conf:<Files ~ "\.(cgi|shtml|phtml|php3?)$">

Is what I get back, as I am fairly new to the worl of php do you see anything that might be causing my problem. The install was a genaric install with RedHat 8.0, all components were installed from the cd's.
 
Old 03-19-2003, 10:37 AM   #4
teded34
LQ Newbie
 
Registered: Feb 2003
Posts: 11

Original Poster
Rep: Reputation: 0
am I better off to upgrade php to 4.3.2, so I will have to deinstall the old version and then install the new version and then connect it with apache, etc.

Can anyone help me with this part, as I need step by step help for I am new to the world of Linux and am still learning.

Or am I missing modules from the original install, and can I just install them. helpppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
 
Old 03-19-2003, 11:13 AM   #5
-G-
LQ Newbie
 
Registered: Mar 2003
Location: North West USA
Distribution: Redhat 8.0 & 9.0, Mandrake 9.0 & 9.2, Fedora Core 1, Knoppix
Posts: 28

Rep: Reputation: 15
I just finished a LAMP install (Linux, Apache, MySQL, PHP). I'm very new to Linux and running Red Hat 8.0. It works great. The link I used was :

LAMP HOWTO Install

I also used this following guide, but was unable to get the SSL stuff to work. I think I now know why though and will probably try this again soon.

Dev Shed Article on LAMP with SSL

I will say that I had to remove a few RPMs first before I started the install. That made it quite a bit cleaner.

Also, you will need to make sure that you have correct compilers install and something called ZLIB. I ran into those two issues during my install, but was able to find and install the right stuff to get it all to work. I know that MySQL installed fine and assume that the PHP installed good (but only tested it with a test page that had the <? PHPinfo(); ?> .

I noticed that when you typed your PHP script you had

<?
echo "WELCOME";
>?

Maybe your post had a typo, but shouldn't the script be:

<?
echo "WELCOME";
?>

Just a thought.

Anyway, hope the links help out. Let us know how it goes with your install. Maybe I can help if you run into some problems or if you have any questions about my post.

-G-
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
php apache or php cgi - php learner rblampain Linux - Security 3 12-18-2004 12:10 AM
New to PHP and Postgressql. Is this a PHP problem or a sql problem. Please help sendas4 Linux - General 2 11-05-2004 02:54 PM
Problem getting PHP to recognize MySQL, Using PHP 4.0 and MySQL 4.0.20 d2army Programming 4 06-27-2004 09:54 PM
RH9: PHP session problem (or Apache problem) fengcn Red Hat 0 12-01-2003 07:32 PM
Apache php index.php problem neurotic Linux - Software 3 11-18-2003 07:02 PM


All times are GMT -5. The time now is 10:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration