SUSE / openSUSE This Forum is for the discussion of Suse Linux. |
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.
|
|
07-26-2005, 01:03 AM
|
#1
|
Member
Registered: Apr 2005
Location: San Francisco, CA
Distribution: Ubuntu, Debian
Posts: 83
Rep:
|
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!
|
|
|
07-26-2005, 07:04 AM
|
#2
|
Senior Member
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591
Rep:
|
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...
|
|
|
07-26-2005, 07:04 AM
|
#3
|
Senior Member
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591
Rep:
|
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
|
|
|
07-26-2005, 06:28 PM
|
#4
|
Senior Member
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291
Rep:
|
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
|
|
|
07-26-2005, 06:33 PM
|
#5
|
Member
Registered: Apr 2005
Location: San Francisco, CA
Distribution: Ubuntu, Debian
Posts: 83
Original Poster
Rep:
|
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?
|
|
|
07-27-2005, 01:26 AM
|
#6
|
Senior Member
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291
Rep:
|
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.
|
|
|
07-27-2005, 03:34 AM
|
#7
|
Senior Member
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591
Rep:
|
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...
|
|
|
07-27-2005, 12:40 PM
|
#8
|
Member
Registered: Apr 2005
Location: San Francisco, CA
Distribution: Ubuntu, Debian
Posts: 83
Original Poster
Rep:
|
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!
|
|
|
All times are GMT -5. The time now is 10:42 PM.
|
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
|
|