Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mod_php: not starting?
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
idiotprogrammer
Apprentice
Apprentice


Joined: 29 Jul 2002
Posts: 179
Location: Texas

PostPosted: Mon Feb 24, 2003 9:45 am    Post subject: mod_php: not starting? Reply with quote

I'm installing apache, mod_php, mod_perl, and mod_dav

things emerge ok and i can get apache to work, but i can't tell if mod_php is working

i wrote a phpinfo script, which only showed text
the apache logs shows that the server information is just apache with no php inolved.

I ran the ebuild scripts and changed APACHE_OPTS="-D SSL -D PHP4" in the startup file.

The problem is that the config files usually have configuration about php in If containers, so it's hard to tell if apache is even php aware. is there a setting I need to make on php config file?

I looked at the apache config files, and nothing looks strange on the mod_php lines. (and anyway, isn't gentoo supposed to make these sort of difficulties old-fashioned?

Anything I've missing?

Robert Nagl e
Back to top
View user's profile Send private message
sergio
Apprentice
Apprentice


Joined: 11 Jun 2002
Posts: 265
Location: Clermont Ferrand, France

PostPosted: Mon Feb 24, 2003 10:49 am    Post subject: Reply with quote

Check your /etc/apache/conf/apache and then is necessary add the lines follow

Code:


<IfDefine PHP4>
LoadModule php4_module    extramodules/libphp4.so
</IfDefine>

....

<IfDefine PHP4>
AddModule mod_php4.c
</IfDefine>

.....

Include  conf/addon-modules/mod_php.conf


Don't forget to restart apache after...

Bye
Back to top
View user's profile Send private message
idiotprogrammer
Apprentice
Apprentice


Joined: 29 Jul 2002
Posts: 179
Location: Texas

PostPosted: Mon Feb 24, 2003 2:53 pm    Post subject: Reply with quote

actually I was surprised to find that these lines weren't in commonapache.conf

I put the lines you mentioned in both conf/apache.conf and commonapache.conf

Still does not work. I'm looking at the server signature when I do http. I see neither mod_ssl or mod_php.

Other ideas?

rj
Back to top
View user's profile Send private message
sergio
Apprentice
Apprentice


Joined: 11 Jun 2002
Posts: 265
Location: Clermont Ferrand, France

PostPosted: Mon Feb 24, 2003 3:07 pm    Post subject: Reply with quote

- Check if apache is started (ps -ef)
- Check the error_log file in /var/log/apache

- Check the syntax of apache's configurations files with

Code:

apache -t


if you have some virtual hosts check its with

Code:

apache -S


From my side, i will try to install apache and mod_php on my workstation to perform some test...

A+ (bye)
Back to top
View user's profile Send private message
sergio
Apprentice
Apprentice


Joined: 11 Jun 2002
Posts: 265
Location: Clermont Ferrand, France

PostPosted: Mon Feb 24, 2003 4:33 pm    Post subject: Reply with quote

Check the "apache" file in /etc/conf.d

uncomment the line follow

Code:

# APACHE_OPTS="-D SSL -D PHP4"


Then save the file, and restart apache...

I think it will work fine now !!

A+ (Bye)
Back to top
View user's profile Send private message
axxackall
l33t
l33t


Joined: 06 Nov 2002
Posts: 651
Location: Toronto, Ontario, 3rd Rock From Sun

PostPosted: Mon Feb 24, 2003 7:52 pm    Post subject: Reply with quote

Same problem here. I think we need Gentoo-PHP-HOWTO about, b/c with current php ebuilds it doesn't work. There is some magic trick that PHP people know, but still did not tell us.

One more time:

Code:

ebuild mod_php ;
uncomment APACHE_OPTS="-D SSL -D PHP4" in /etc/conf.d ;
check for the for LoadModule and AddModule line in /etc/apache/conf.apache.conf (in fact, they have already been there);
ebuild phpBB ;
/etc/init.d/apache restart
lynx http://localhost/phpbb


and all php code is right in the browser screen.

So, what's the secret?
Back to top
View user's profile Send private message
jgaynor
n00b
n00b


Joined: 24 Feb 2003
Posts: 10
Location: New Brunswick, NJ

PostPosted: Mon Feb 24, 2003 8:17 pm    Post subject: Im stuck with mod_php also :( Reply with quote

I seem to be have the same problem as you, idiotprogrammer. After some wrestling I was able to succesfully install php using the java USE option. Mod_php was the same way. My apache.conf and apache file look kosher but no go with apache serving any php files. Im testing using phpsysinfo, and apache just attempts to send the index file as a download. Glad this isn;t just me - I was beginning to think I had gotten in over my head with gentoo :).
Back to top
View user's profile Send private message
waverider202
Tux's lil' helper
Tux's lil' helper


Joined: 25 Sep 2002
Posts: 146
Location: Drexel University

PostPosted: Mon Feb 24, 2003 9:27 pm    Post subject: php Reply with quote

I noticed this problem back when 4.3 was released. I couldn't figure out for the life of me what was causing it not to work, so I solved the problem in the most elagent way I could:

emerge php-4.2.3.ebuild
_________________
:-P
Back to top
View user's profile Send private message
idiotprogrammer
Apprentice
Apprentice


Joined: 29 Jul 2002
Posts: 179
Location: Texas

PostPosted: Mon Feb 24, 2003 10:50 pm    Post subject: php and other bugs Reply with quote

in response to jgaynor:

interestingly, I used use="-java" because of another emerge bug related to java. Perhaps these two bugs are related.

https://forums.gentoo.org/viewtopic.php?t=36518&highlight=modphp

It's worth trying everything again from scratch to make sure I didn't forget anything.

Problems.
Back to top
View user's profile Send private message
axxackall
l33t
l33t


Joined: 06 Nov 2002
Posts: 651
Location: Toronto, Ontario, 3rd Rock From Sun

PostPosted: Mon Feb 24, 2003 11:06 pm    Post subject: Reply with quote

Sometime I wonder, why packages with so obvious bugs are unmasked, while many packages, good and stable, are still masked.
Back to top
View user's profile Send private message
tdrobinson
n00b
n00b


Joined: 25 Feb 2003
Posts: 4
Location: Kentucky

PostPosted: Tue Feb 25, 2003 3:58 pm    Post subject: mod_php problems fix Reply with quote

I have the fix. I tell you this really frustrated me.

It is the order that the modules are loaded in the /etc/apache/conf/apache.conf file. Make sure that the following vhost line is after the php module line.

LoadModule vhost_alias_module modules/mod_vhost_alias.so

Like so:

<IfDefine PHP4>
LoadModule php4_module extramodules/libphp4.so
</IfDefine>
<IfDefine SSL>
LoadModule ssl_module extramodules/libssl.so
</IfDefine>
LoadModule vhost_alias_module modules/mod_vhost_alias.so
Back to top
View user's profile Send private message
idiotprogrammer
Apprentice
Apprentice


Joined: 29 Jul 2002
Posts: 179
Location: Texas

PostPosted: Tue Feb 25, 2003 6:00 pm    Post subject: thanks, I'll try it! Reply with quote

You know, last time, I came home exhausted and instead of trying to investigate this problem further, I ended up watching tv and falling asleep.

This solution sounds very hopeful. I'll try it tonight. Thanks!

rj
Back to top
View user's profile Send private message
b0d0r
n00b
n00b


Joined: 04 Jan 2003
Posts: 30

PostPosted: Tue Feb 25, 2003 11:43 pm    Post subject: Reply with quote

also if you comment out or remove the <ifdefine> and </ifdefine> for each module that you want to use... you will find that will get it to work...

well i did it and it works for me :)
Back to top
View user's profile Send private message
barnaclebarnes
n00b
n00b


Joined: 23 Oct 2002
Posts: 11
Location: London

PostPosted: Fri Feb 28, 2003 11:32 am    Post subject: Reply with quote

axxackall wrote:
Same problem here. I think we need Gentoo-PHP-HOWTO about, b/c with current php ebuilds it doesn't work. There is some magic trick that PHP people know, but still did not tell us.

One more time:

Code:

ebuild mod_php ;
uncomment APACHE_OPTS="-D SSL -D PHP4" in /etc/conf.d ;
check for the for LoadModule and AddModule line in /etc/apache/conf.apache.conf (in fact, they have already been there);
ebuild phpBB ;
/etc/init.d/apache restart
lynx http://localhost/phpbb


and all php code is right in the browser screen.

So, what's the secret?


I did all of this and it still wouldn't work. The issue is that apache was not picking up the APACHE_OPTS directives. Try and start apache by just typing:

Code:

apache -D PHP4


Then try and load a test php page. This worked for me. I agree that the php install does seem to be a nightmare. It should really add the correct lines to the apache configuration files, after all a standard php compile will do it for you.
Back to top
View user's profile Send private message
Mord
n00b
n00b


Joined: 09 Jan 2003
Posts: 68
Location: Where the rubber meets the road.

PostPosted: Sun Mar 02, 2003 10:08 pm    Post subject: Reply with quote

Gah! Thanks for this thread.

I just updated apache and php, and I manually clobbered my own /etc/conf.d/apache file. PHP wasn't starting.....

Just had to remove the comment by the line

APACHE_OPTS="-D SSL -D PHP4"

and all was well.
_________________
I feel more like I do now than I did when I got here.
Back to top
View user's profile Send private message
ultraslacker
Tux's lil' helper
Tux's lil' helper


Joined: 03 Aug 2002
Posts: 124
Location: lazy fairy land

PostPosted: Wed Mar 05, 2003 6:37 pm    Post subject: Reply with quote

b0d0r wrote:
also if you comment out or remove the <ifdefine> and </ifdefine> for each module that you want to use... you will find that will get it to work...


apachectl will not read the apache opts found in config file /etc/conf.d/apache. For that config file to be effective, you have to start apache via the script in /etc/init.d/
Back to top
View user's profile Send private message
jgaynor
n00b
n00b


Joined: 24 Feb 2003
Posts: 10
Location: New Brunswick, NJ

PostPosted: Thu Mar 06, 2003 11:01 pm    Post subject: Eureeka! Reply with quote

WOOHOO! FINALLY!

Man this problem took a LONG time to fix - truthfully its STILL not fixed but I've got it jury-rigged enough to work. I decided to restart from square one. Uninstalled apache, php & mod_php . . .
Code:
emerge unmerge apache php mod_php

reinstalled apache - no problems . . .
Code:
emerge apache

reinstalled php (can't remember what options I used to get that to work and mod_php - had to use the -jave and -qt options to get them to work (props to darktux on that one) . . .
Code:
USE="-qt -qtmt -java" emerge mod_php

I removed the comment from this line in my /etc/conf.d/apache file:
APACHE_OPTS="-D SSL -D PHP4"
but still no luck after restarting apache :( . So I stopped it and started it using the following command (thanks barnaclebarnes):
Code:
apache -D PHP4

and IT WORKED! Now this will not work when I reboot the box but it's a start. Obviously apache is not getting its variables from /etc/conf.d/apache correctly. Anyone have any thoughts as to why? I'd be happy to post my conf files.
Back to top
View user's profile Send private message
sebgarden
Guru
Guru


Joined: 21 Dec 2002
Posts: 353

PostPosted: Fri Mar 07, 2003 2:41 am    Post subject: Reply with quote

OK, here I have an interesting thing:

Code:

bash-2.05b# apache2ctl stop
Syntax error on line 79 of /etc/apache2/conf/apache2.conf:
Cannot load /etc/apache2/extramodules/libphp4.so into server: /etc/apache2/extramodules/libphp4.so: undefined symbol: mysql_drop_db
bash-2.05b#

:(
This error appear only when the following line in apache2.conf is uncommented:
Code:

LoadModule php4_module    extramodules/libphp4.so

This is an error of php binding with mysql ? The other modules loaded without a hint from /etc/apache2/conf/modules.d/ and /etc/apache2/conf/extramodules/.

From the php page, I read that they don't assure the good compatibility of the bleeding-edge php and mysql. Has someone an idea about this issue ?

Regards,
Sébastien.
Back to top
View user's profile Send private message
sebgarden
Guru
Guru


Joined: 21 Dec 2002
Posts: 353

PostPosted: Fri Mar 07, 2003 3:03 am    Post subject: Reply with quote

And I forgot to mention that commenting this line doesn't enable my browser to read phpinfo.php !

Sébastien
Back to top
View user's profile Send private message
marsf
n00b
n00b


Joined: 02 Mar 2003
Posts: 10

PostPosted: Sat Mar 08, 2003 12:16 am    Post subject: Reply with quote

Ok, I'm willing to try a little experiment if anyone else is up for it. I've been working on this for a while and for all intents and purposes it looks like PHP is running, but it just won't execute any script!

So, here is my proposition. I've posted a tarball of my /etc/apache directory on my web site at http://www.redplanet.ca/temp/apache.tar. All someone has to do is untar it to /tmp and run the command:

diff /etc/apache /tmp/apache -r {some other options, wbB maybe}

I am running apache-1.3.27-r3 with mod_php-4.3.1

This setup should be out-of-the-box. As far as I can tell the config files are fine and all the needed settings are in there. I have tried running the server with the "/etc/inid.d/apache" script, as well as with "/sbin/apache -D PHP4" and both commands would appear to be working from the log files as well as the http://localhost/server-status page. These show the PHP 4.3.1 module being loaded up and configured. However, the server will only spit PHP code back at me, no matter what I try.

So I would really like to know what is different between my setup and everyone else's? What are the differences between a working setup and my own? Comparing the config tree should at the least indicate whether or not the problem is in the configuration or elsewhere.

It is also worth noting that I had to use the USE="-qt -java" flags to get mod_php to compile in the first place.

So, who has a working configuration using these two packages, and what are the differences between that configuration and mine?


Mars
Back to top
View user's profile Send private message
sebgarden
Guru
Guru


Joined: 21 Dec 2002
Posts: 353

PostPosted: Sat Mar 08, 2003 2:34 pm    Post subject: Reply with quote

Well, I'm running apache-2.0.44, mysql-3.23.55 (downgrading last night), php-4.3.1 with mod_php-4.3.1-r1 and it's just running fine (Now :) ).

Sébastien
Back to top
View user's profile Send private message
sweede
n00b
n00b


Joined: 02 Jan 2003
Posts: 45

PostPosted: Tue Mar 11, 2003 1:01 pm    Post subject: Reply with quote

as it is said above, check the /etc/init.d/apache script to see if it is loading the APACHE_OPTS in /etc/conf.d/apache

rename the stop() function to something like, _stop()

and then add the following,

stop() {
ebegin ${APACHE_OPTS}
}

running /etc/init.d/apache stop (you must start it first) should return
Code:

sweede@soulfly sweede $ sudo /etc/init.d/apache stop
 * -D SSL -D PHP4...



if not, you have other issues either in the rc script or in your /etc/conf.d/apache file
Back to top
View user's profile Send private message
karl11
Guru
Guru


Joined: 25 Jun 2002
Posts: 469
Location: Raleigh, NC

PostPosted: Thu Mar 13, 2003 6:25 am    Post subject: Reply with quote

Quote:

*
* To have Apache run php programs, please do the following:
* 1. Execute the command:
* "ebuild /var/db/pkg/dev-php/mod_php-4.3.1/mod_php-4.3.1.ebuild config"
* 2. Edit /etc/conf.d/apache and add "-D PHP"
*
* That will include the php mime types in your configuration
* automagically and setup Apache to load php when it starts.


for all with mod_php problems, did you at least do the above like the ebuild says? This was my problem....looking over directions since I emerge mod_php with a bunch of other builds.

Karl
Back to top
View user's profile Send private message
marsf
n00b
n00b


Joined: 02 Mar 2003
Posts: 10

PostPosted: Thu Mar 13, 2003 8:47 pm    Post subject: Reply with quote

Well, PHP finally works, but I don't know how.

I unmerged mod_php, and then as an expriment built and installed normal PHP 4.3.1. The normal PHP didn't work either.

Just now I reinstalled mod_php so that I could try the above solution. But I didn't get that far, because everything works perfectly now?

Maybe it has something to do with having normal non-gentoo PHP and gentoo mod_php installed at the same time.

Strange.


Mars
Back to top
View user's profile Send private message
olivierweb
Tux's lil' helper
Tux's lil' helper


Joined: 09 Dec 2002
Posts: 113
Location: France

PostPosted: Mon Mar 17, 2003 12:27 pm    Post subject: Reply with quote

I've got some problem for running mod_php. So I do the changes for the /etc files

axxackall wrote:
USE="-java -qt" ebuild mod_php ;
uncomment APACHE_OPTS="-D SSL -D PHP4" in /etc/conf.d ;
check for the for LoadModule and AddModule line in /etc/apache/conf/apache.conf


this was not enough, so I do this :

b0d0r wrote:
also if you comment out or remove the <ifdefine> and </ifdefine> for each module that you want to use... you will find that will get it to work...

well i did it and it works for me :)


And mod_php works !

Thanks everybody !
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum