LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 07-26-2005, 01:03 AM   #1
elliotfuller
Member
 
Registered: Apr 2005
Location: San Francisco, CA
Distribution: Ubuntu, Debian
Posts: 83

Rep: Reputation: 15
Talking Parsing PHP Scripts using Apache in SuSe 9.3 (without a dedicated server)


\\I have been using SuSe Linux for some time now. I am happy with Linux, except for some of its package system management, non parallel booting, general lagging. All of which are things I am willing to work with since I have a strong belief in Open Source. I think SuSe is one of the few distributions that can appeal and succeed.\\

That being said I have set up my graphics card, network card, keyboard and other hassles one runs into when running linux on laptops. But for some reason I have been unable to get Apache to parse my PHP scripts so I can view there HTML output. I have ran a lot of searches on configuring LAMP for SuSe 9.3 But nothing seems to work. (I'll admit that I am a novice searcher)

I have configured my sysconfig/apache2.conf to parse PHP5 files, activated apache2 for runtime level services, configured it for booting up, gone through all of the obvious YaST protocols. Nothing seems to work. Maybe its because I switched from PHP4 (default install) to PHP5?

I have a feeling that this might have something to do with the fact that that I Don't know much about configuring Apache manually. I am trying to go straight into PHP5 programming. I create my hello world script and save it as hello.php and navigate with firefox to its directory, but it asks me which application to open it with! Ahh! Does this have something to do with mime file types? Where do I find that? I just want to test my PHP installation to see if Apache is correctly parsing my scripts!

References, suggestions and comments PLEASE!
 
Old 07-26-2005, 07:04 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
i see 2 considerable options:
1. throw away php5 and start with php4 and the usual suse installation.
2. get and build a new apache from source, configure with php5

The second step is very well documented and is only necessary if you need php5. The first is much easier and faster.

To edit the suse config files is a job for those who know what they are doing or those who have plenty of time i. e. some weeks...
 
Old 07-26-2005, 07:04 AM   #3
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
i see 2 considerable options:
1. throw away php5 and start with php4 and the usual suse installation.
2. get and build a new apache from source, configure with php5

The second step is very well documented and is only necessary if you need php5. The first is much easier and faster.

To edit the suse config files is a job for those who know what they are doing or those who have plenty of time i. e. some weeks...

so i really recommend one of the first. cheers, j
 
Old 07-26-2005, 06:28 PM   #4
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
I've started learning php4 programming myself so I understand what your going through, it's best to use php4, i've heard of a lot of poeple having issues trying to get php5 to run right. I always best to download the tar files instead of using rpm's and compile them from source, a lot of distros seem to place files in different places from the standard installs.

Yes is does matter how and which order you configure both apache and php, here's the order and the configuration for both apache and php, step 15 and 16 you can leave out and will still work:

Apache Module

PHP can be compiled in a number of different ways as an Apache module. First we show the quick instructions. Following this is a list of various examples with explanations, to provide an overview of how to accomplish certain things.

You can select arguments to add to the configure on line 8 below from the Complete list of configure options.

Example 2-1. Quick Installation Instructions (Apache Module Version)

1. gunzip apache_1.3.x.tar.gz | tar -xvf -

2. tar -xvf apache_1.3.x.tar

3. gunzip php-x.x.x.tar.gz | tar -xvf -

4. tar -xvf php-x.x.x.tar

5. cd apache_1.3.x

6. ./configure --prefix=/www

7. cd ../php-x.x.x

8. ./configure --with-mysql --with-apache=../apache_1.3.x --enable-track-vars

9. make

10. make install

11. cd ../apache_1.3.x

12. for PHP 3: ./configure --activate-module=src/modules/php3/libphp3.a

for PHP 4: ./configure --activate-module=src/modules/php4/libphp4.a

13. make

14. make install



Instead of this step you may prefer to simply copy the httpd binary

overtop of your existing binary. Make sure you shut down your

server first though.



15. cd ../php-x.x.x

16. for PHP 3: cp php3.ini-dist /usr/local/lib/php3.ini

for PHP 4: cp php.ini-dist /usr/local/lib/php.ini



You can edit your .ini file to set PHP options. If

you prefer this file in another location, use

--with-config-file-path=/path in step 8.



17. Edit your httpd.conf or srm.conf file and add:


For PHP 3: AddType application/x-httpd-php3 .php3

For PHP 4: AddType application/x-httpd-php .php

You can choose any extension you wish here. .php is simply the one

we suggest. You can even include .html .


18. Use your normal procedure for starting the Apache server. (You must

stop and restart the server, not just cause the server to reload by

use a HUP or USR1 signal.)


Compiling from source will put the apache.conf file in /sr/local/apache/conf/httpd.conf

and to start your server use the command:

/usr/local/apache/bin/apachectl start

you can add this line to your /etc/rc.d/rc.local, or i think for suse it will be /etc/rc.d/rc.boot file and your server will start at boot time.

Have any trouble just ask
 
Old 07-26-2005, 06:33 PM   #5
elliotfuller
Member
 
Registered: Apr 2005
Location: San Francisco, CA
Distribution: Ubuntu, Debian
Posts: 83

Original Poster
Rep: Reputation: 15
Thanks! I appreciate some real help! Only problem is I have a book on learning PHP5 not PHP4. How different are the two? Can I pretty much use most of my book? Or will I have to buy a new one if I want PHP4?
 
Old 07-27-2005, 01:26 AM   #6
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
Unfortunately i'm only new to it too, about a week or so I could say what the differences are between the two. Step 8 and 12 may be the only thing you have to change to compile php5, might need to check out some php5 sites, they will probably have an answer some where about the configuration.

I'd say you could pretty well use most of the book you already have, the php5 version will probably only be different by the security updates and some new features, but the core of the language will be the same, but don't quote me on that.
 
Old 07-27-2005, 03:34 AM   #7
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
u can use it, no doubt. most of syntax and functions are the same. there are differences in object oriented approach and possibilities. php4 is still in use on most production servers anyway. ISPs take their time to make changes and accept new technologies. So i guess it will take more than a year from now until php5 pushes thru...
 
Old 07-27-2005, 12:40 PM   #8
elliotfuller
Member
 
Registered: Apr 2005
Location: San Francisco, CA
Distribution: Ubuntu, Debian
Posts: 83

Original Poster
Rep: Reputation: 15
I don't want to use a deprecated version of Apache! So I downloaded the source for Apache2. I then downloaded the source for PHP5. I compiled them from source (in the order described), but the options for ./configure didn't work (even with changing to the obvious new syntax). So, I had to do a plain ./configure without any options. I think the options are necessary for getting Apache2 to parse because it didn't work at all. I am going to look for documentation on compiling the newer sources together. I also tried uninstalling all apache, php and mySQL packages. Then I tried installing mySQL, PHP4 and then Apache2 (using YaST and SuSe's sources). I used the necessary Yast protocols to have the Apache server run and again, firefox asks me which application to open the page with, no HTML output!
 
  


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
Running PHP Scripts in SuSe Linux 9.3 w/o a server. elliotfuller Linux - Software 3 06-18-2005 07:27 PM
Apache-ssl not correctly parsing php files jme Linux - Software 2 05-03-2005 01:04 PM
how do i Know Apache PHP MYSQL Installed on my Dedicated Server? phpsharma Linux - Newbie 3 04-18-2005 06:40 PM
Need help to configure Apache TO EXECUTE PHP SCRIPTS mgrapr Linux - Hardware 2 01-21-2004 10:23 AM
Apache not running php scripts Seventh Linux - Newbie 3 01-08-2004 09:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 10:42 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
Open Source Consulting | Domain Registration