View previous topic :: View next topic |
Author |
Message |
idiotprogrammer Apprentice
Joined: 29 Jul 2002 Posts: 179 Location: Texas
|
Posted: Mon Feb 24, 2003 9:45 am Post subject: mod_php: not starting? |
|
|
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 |
|
|
sergio Apprentice
Joined: 11 Jun 2002 Posts: 265 Location: Clermont Ferrand, France
|
Posted: Mon Feb 24, 2003 10:49 am Post subject: |
|
|
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 |
|
|
idiotprogrammer Apprentice
Joined: 29 Jul 2002 Posts: 179 Location: Texas
|
Posted: Mon Feb 24, 2003 2:53 pm Post subject: |
|
|
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 |
|
|
sergio Apprentice
Joined: 11 Jun 2002 Posts: 265 Location: Clermont Ferrand, France
|
Posted: Mon Feb 24, 2003 3:07 pm Post subject: |
|
|
- 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
if you have some virtual hosts check its with
From my side, i will try to install apache and mod_php on my workstation to perform some test...
A+ (bye) |
|
Back to top |
|
|
sergio Apprentice
Joined: 11 Jun 2002 Posts: 265 Location: Clermont Ferrand, France
|
Posted: Mon Feb 24, 2003 4:33 pm Post subject: |
|
|
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 |
|
|
axxackall l33t
Joined: 06 Nov 2002 Posts: 651 Location: Toronto, Ontario, 3rd Rock From Sun
|
Posted: Mon Feb 24, 2003 7:52 pm Post subject: |
|
|
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 |
|
|
jgaynor n00b
Joined: 24 Feb 2003 Posts: 10 Location: New Brunswick, NJ
|
Posted: Mon Feb 24, 2003 8:17 pm Post subject: Im stuck with mod_php also :( |
|
|
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 |
|
|
waverider202 Tux's lil' helper
Joined: 25 Sep 2002 Posts: 146 Location: Drexel University
|
Posted: Mon Feb 24, 2003 9:27 pm Post subject: php |
|
|
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 _________________
|
|
Back to top |
|
|
idiotprogrammer Apprentice
Joined: 29 Jul 2002 Posts: 179 Location: Texas
|
Posted: Mon Feb 24, 2003 10:50 pm Post subject: php and other bugs |
|
|
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 |
|
|
axxackall l33t
Joined: 06 Nov 2002 Posts: 651 Location: Toronto, Ontario, 3rd Rock From Sun
|
Posted: Mon Feb 24, 2003 11:06 pm Post subject: |
|
|
Sometime I wonder, why packages with so obvious bugs are unmasked, while many packages, good and stable, are still masked. |
|
Back to top |
|
|
tdrobinson n00b
Joined: 25 Feb 2003 Posts: 4 Location: Kentucky
|
Posted: Tue Feb 25, 2003 3:58 pm Post subject: mod_php problems fix |
|
|
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 |
|
|
idiotprogrammer Apprentice
Joined: 29 Jul 2002 Posts: 179 Location: Texas
|
Posted: Tue Feb 25, 2003 6:00 pm Post subject: thanks, I'll try it! |
|
|
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 |
|
|
b0d0r n00b
Joined: 04 Jan 2003 Posts: 30
|
Posted: Tue Feb 25, 2003 11:43 pm Post subject: |
|
|
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 |
|
|
barnaclebarnes n00b
Joined: 23 Oct 2002 Posts: 11 Location: London
|
Posted: Fri Feb 28, 2003 11:32 am Post subject: |
|
|
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:
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 |
|
|
Mord n00b
Joined: 09 Jan 2003 Posts: 68 Location: Where the rubber meets the road.
|
Posted: Sun Mar 02, 2003 10:08 pm Post subject: |
|
|
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 |
|
|
ultraslacker Tux's lil' helper
Joined: 03 Aug 2002 Posts: 124 Location: lazy fairy land
|
Posted: Wed Mar 05, 2003 6:37 pm Post subject: |
|
|
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 |
|
|
jgaynor n00b
Joined: 24 Feb 2003 Posts: 10 Location: New Brunswick, NJ
|
Posted: Thu Mar 06, 2003 11:01 pm Post subject: Eureeka! |
|
|
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 . . .
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):
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 |
|
|
sebgarden Guru
Joined: 21 Dec 2002 Posts: 353
|
Posted: Fri Mar 07, 2003 2:41 am Post subject: |
|
|
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 |
|
|
sebgarden Guru
Joined: 21 Dec 2002 Posts: 353
|
Posted: Fri Mar 07, 2003 3:03 am Post subject: |
|
|
And I forgot to mention that commenting this line doesn't enable my browser to read phpinfo.php !
Sébastien |
|
Back to top |
|
|
marsf n00b
Joined: 02 Mar 2003 Posts: 10
|
Posted: Sat Mar 08, 2003 12:16 am Post subject: |
|
|
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 |
|
|
sebgarden Guru
Joined: 21 Dec 2002 Posts: 353
|
Posted: Sat Mar 08, 2003 2:34 pm Post subject: |
|
|
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 |
|
|
sweede n00b
Joined: 02 Jan 2003 Posts: 45
|
Posted: Tue Mar 11, 2003 1:01 pm Post subject: |
|
|
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 |
|
|
karl11 Guru
Joined: 25 Jun 2002 Posts: 469 Location: Raleigh, NC
|
Posted: Thu Mar 13, 2003 6:25 am Post subject: |
|
|
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 |
|
|
marsf n00b
Joined: 02 Mar 2003 Posts: 10
|
Posted: Thu Mar 13, 2003 8:47 pm Post subject: |
|
|
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 |
|
|
olivierweb Tux's lil' helper
Joined: 09 Dec 2002 Posts: 113 Location: France
|
Posted: Mon Mar 17, 2003 12:27 pm Post subject: |
|
|
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 |
|
|
|