View previous topic :: View next topic |
Author |
Message |
ordior Guest
|
Posted: Mon Apr 15, 2002 11:46 pm Post subject: Apache, PHP, mySQL |
|
|
I have just put together a simple web-server, the only installed .ebuilds are apache, php, mySQL and openSSH. SSH is working (outbound at least, I havn't tried logging in yet) and apache is serving html ok. But I have a problem with php: I have (I think) configured apache and php correctly but I am not getting any output from a test.php page, the html component of the page is displayed but a section in the middle which should be displaying phpinfo() is just ignored. This I find unusual, usually such a page would display the php code if php would not work at all. I've probably missed something very obvious, could anyone give a check list of things I should have done.
Also on installing mySQL after mysql_install_db and starting mysql I was unable to change the mysql root password as I got an error about a non-existant mysql.socket2
|
|
Back to top |
|
|
Roy n00b
Joined: 15 Apr 2002 Posts: 55 Location: Australia
|
Posted: Tue Apr 16, 2002 12:01 am Post subject: |
|
|
I had a similar problem with php as you. In the httpd.conf file that comes with the gentoo install of apache there will be lines like:
Code: |
<IfDefine PHP4>
LoadModule php4_module /usr/lib/apache/libphp4.so
</IfDefine>
|
I have no idea how to use the IfDefine in apache so I usually just ignore it. To get PHP working on my machine I just went through the config file and commented out all the PHP4 IfDefine's to ensure that the php4 module was being loaded.
Unfortuanly I have no idea about your MySQL problem. _________________ /* Halley */
(Halley's comment.) |
|
Back to top |
|
|
Harri n00b
Joined: 12 Apr 2002 Posts: 21 Location: Helsinki
|
Posted: Tue Apr 16, 2002 12:17 am Post subject: |
|
|
PHP help:
Check the /etc/conf.d/apache file (with old apache ebuild httpd file). Make sure the APACHE_OPTS="-D PHP4" is uncommented. That option turns on PHP support, no need to comment out the IfDefines lines.
MySQL help:
Not sure about the MySQL problem, but check that in your /etc/mysql/my.cnf file the socket under [client] and [mysqld] has /var/run/mysqld/mysqld.sock. If this doesn't help you can try to change the socket to /tmp/mysqld.sock (might help if there is a permission problem). |
|
Back to top |
|
|
Roy n00b
Joined: 15 Apr 2002 Posts: 55 Location: Australia
|
Posted: Tue Apr 16, 2002 12:44 am Post subject: |
|
|
Harri wrote: | PHP help:
Check the /etc/conf.d/apache file (with old apache ebuild httpd file). Make sure the APACHE_OPTS="-D PHP4" is uncommented. That option turns on PHP support, no need to comment out the IfDefines lines.
|
So thats how you do it. I'll have to remember that one. _________________ /* Halley */
(Halley's comment.) |
|
Back to top |
|
|
niyogi Apprentice
Joined: 10 Apr 2002 Posts: 199 Location: Austin, TX
|
Posted: Tue Apr 16, 2002 2:05 am Post subject: |
|
|
does the php ebuild come enabled with mysql AND postgresql support?
-S |
|
Back to top |
|
|
Guest
|
Posted: Tue Apr 16, 2002 2:16 am Post subject: Re: Apache, PHP, mySQL |
|
|
ordior wrote: | Also on installing mySQL after mysql_install_db and starting mysql I was unable to change the mysql root password as I got an error about a non-existant mysql.socket2 |
Is it possible that you didn't start the mySQL service? try typing into the command line as root "/etc/init.d/mysql start" and then see if it works.
Ken |
|
Back to top |
|
|
Roy n00b
Joined: 15 Apr 2002 Posts: 55 Location: Australia
|
Posted: Tue Apr 16, 2002 4:56 am Post subject: |
|
|
niyogi wrote: | does the php ebuild come enabled with mysql AND postgresql support?
-S |
I you have 'mysql' and I assume a similar sort of thing for postgres in your USE tag then PHP will build with MySQL support. Pretty sure thats what I had to do to get it working on my machine. _________________ /* Halley */
(Halley's comment.) |
|
Back to top |
|
|
Guzz n00b
Joined: 16 Apr 2002 Posts: 25 Location: Sweden
|
Posted: Tue Apr 16, 2002 7:42 am Post subject: |
|
|
I have
Code: |
APACHE_OPTS="-D PHP4"
|
in /etc/conf.d/apache, and I have
Code: |
<IfDefine PHP4>
LoadModule php4_modules extramodules/libphp4.so
</IfDefine>
|
in /etc/apache/conf/apache.conf.
And PHP still doesn't work, any ideas? _________________ That's it Mr. Giraff, get all the marmalade. |
|
Back to top |
|
|
Guzz n00b
Joined: 16 Apr 2002 Posts: 25 Location: Sweden
|
Posted: Tue Apr 16, 2002 9:43 am Post subject: |
|
|
Ok, solved the problem.
Here's what I had to do.
(step by step)
Code: |
#emerge apache php
#rc-update add apache default
#apacheaddmod /etc/apache/conf/apache.conf extramodules/libphp4.so mod_php4.c php4_module before=perl define=PHP4 addconf=addon-modules/mod_php4.conf
|
And that took care of it all.
It didn't add it as <IfDefine> so there wa no need to edit /etc/conf.d/apache. _________________ That's it Mr. Giraff, get all the marmalade. |
|
Back to top |
|
|
Belg Guest
|
Posted: Tue Apr 16, 2002 1:45 pm Post subject: Mysql |
|
|
I had that problem with MySQL too. The directory where the pid-file and socket was supposed to be placed was never created, so mysql never actually started.
I Don't remember where off the top of my head, but I think it was /var/run/mysqld/. |
|
Back to top |
|
|
Yoda n00b
Joined: 16 Apr 2002 Posts: 8
|
Posted: Wed Apr 17, 2002 12:24 am Post subject: |
|
|
Guzz wrote: | Ok, solved the problem.
Here's what I had to do.
(step by step)
Code: |
#emerge apache php
#rc-update add apache default
#apacheaddmod /etc/apache/conf/apache.conf extramodules/libphp4.so mod_php4.c php4_module before=perl define=PHP4 addconf=addon-modules/mod_php4.conf
|
And that took care of it all.
It didn't add it as <IfDefine> so there wa no need to edit /etc/conf.d/apache. |
This almost worked for me, but I had to use different paths. I don't know why. As below:
Code: |
#apacheaddmod /etc/apache/conf/apache.conf extramodules/libphp4.so mod_php4.c php4_module before=perl define=PHP4 addconf=conf/addon-modules/mod_php.conf
|
|
|
Back to top |
|
|
KraGorn n00b
Joined: 17 Apr 2002 Posts: 40 Location: Warrington, England
|
Posted: Wed Apr 17, 2002 7:51 am Post subject: |
|
|
I dropped by here because I started installing gentoo last night using stage 1, next step is kernel build, and am thinking ahead ... my system is for the exactly the same purposes as odior's: apache, ssh etc.
I have a general question about what you guys are discussing: where is this documented?
For instance, where are these steps documented:
#rc-update add apache default
#apacheaddmod
Clearly the first is a gentoo script while the second is Apache's. I presume there's a 'man' for both, but that begs the question ... how would I know they exist in the first place?
In the past when installing Apache from source I've had to ./configure a raft of things to get the modules I wanted, but gentoo doesn't make it easy to run ./configure ... I've read the FAQ section where it's described and it's somewhat fiddly ... and in this thread there's no mention of running it so I'm wondering how, for example, you tell the build to include PHP, SSL, PERL, MYSQL etc.
Basically, what other documentation exists apart from the FAQ and Portage manuals because it seems I'm missing something _________________ You'll never catch ME using a sig.! |
|
Back to top |
|
|
dacoval n00b
Joined: 17 Apr 2002 Posts: 6 Location: Qld, Australia
|
Posted: Wed Apr 17, 2002 10:16 am Post subject: |
|
|
Remember that unless you change the location of the socket in the php.ini file, php will not be able to talk to MySQL, as it defaults to looking in /tmp/ and Gentoo put it in /var/run/mysqld/ |
|
Back to top |
|
|
eyevee99 Apprentice
Joined: 16 Apr 2002 Posts: 239
|
Posted: Sat Oct 19, 2002 5:00 am Post subject: |
|
|
Code: |
bash-2.05a# /etc/init.d/apache start
* Starting apache...
Syntax error on line 58 of /etc/apache/conf/apache.conf:
Can't locate API module structure `php4_modules' in file /etc/apache/extramodules/libphp4.so: /usr/sbin/apache: undefined symbol: php4_modules [ !! ]
|
Any ideas on what this means? |
|
Back to top |
|
|
eyevee99 Apprentice
Joined: 16 Apr 2002 Posts: 239
|
Posted: Sat Oct 19, 2002 5:12 am Post subject: |
|
|
I "fixed" that error by running
Code: |
/etc/init.d/apache stop
apache
/etc/init.d/apache start
|
However I still don't get any working php, all I ger on screen is "' ?>"
even a hello world fails
?? |
|
Back to top |
|
|
eyevee99 Apprentice
Joined: 16 Apr 2002 Posts: 239
|
Posted: Sat Oct 19, 2002 5:41 am Post subject: |
|
|
basically, restarted from scratch, emerged mod_php etc from the beginning. All works now.
follow the on screen instructions and it works first time.
;) |
|
Back to top |
|
|
lostinlinux Guru
Joined: 05 Oct 2002 Posts: 341
|
Posted: Wed Jan 08, 2003 1:48 am Post subject: |
|
|
I am really stuck on this, I have tried to follow the step by step posted on this page and I still get nothing from PHP pages. I can't even get phpinfo to work. If someone can do me a favor and post a step by step fix to this I'd appreciate it |
|
Back to top |
|
|
sariabod n00b
Joined: 21 Aug 2002 Posts: 5
|
Posted: Thu Jan 09, 2003 7:43 pm Post subject: |
|
|
Following the posts, here is what I did, it might not be the best way, but it worked.
#emerge apache
#emerge php
#emerge mod_php
#apacheaddmod /etc/apache/conf/apache.conf extramodules/libphp4.so mod_php4.c php4_module before=perl define=PHP4 addconf=/etc/apache/conf/addon-modules/mod_php.conf
#/etc/init.d/apache start |
|
Back to top |
|
|
Dragon561 Tux's lil' helper
Joined: 25 Oct 2002 Posts: 112
|
Posted: Sat Jun 21, 2003 7:42 pm Post subject: |
|
|
Yea that still didn't work for me either. |
|
Back to top |
|
|
psoutham n00b
Joined: 22 Jun 2003 Posts: 2 Location: California
|
Posted: Sun Jun 22, 2003 10:42 pm Post subject: |
|
|
Dragon561 wrote: | Yea that still didn't work for me either. |
I didn't have much luck with
Code: | #apacheaddmod /etc/apache/conf/apache.conf extramodules/libphp4.so mod_php4.c php4_module before=perl define=PHP4 addconf=/etc/apache/conf/addon-modules/mod_php.conf |
unill I added
Code: | APACHE_OPTS="-D PHP4" |
in /etc/conf.d/apache. |
|
Back to top |
|
|
|