Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache, PHP, mySQL
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
ordior
Guest





PostPosted: Mon Apr 15, 2002 11:46 pm    Post subject: Apache, PHP, mySQL Reply with quote

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
n00b


Joined: 15 Apr 2002
Posts: 55
Location: Australia

PostPosted: Tue Apr 16, 2002 12:01 am    Post subject: Reply with quote

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
View user's profile Send private message
Harri
n00b
n00b


Joined: 12 Apr 2002
Posts: 21
Location: Helsinki

PostPosted: Tue Apr 16, 2002 12:17 am    Post subject: Reply with quote

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
View user's profile Send private message
Roy
n00b
n00b


Joined: 15 Apr 2002
Posts: 55
Location: Australia

PostPosted: Tue Apr 16, 2002 12:44 am    Post subject: Reply with quote

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
View user's profile Send private message
niyogi
Apprentice
Apprentice


Joined: 10 Apr 2002
Posts: 199
Location: Austin, TX

PostPosted: Tue Apr 16, 2002 2:05 am    Post subject: Reply with quote

does the php ebuild come enabled with mysql AND postgresql support?

-S
Back to top
View user's profile Send private message
Guest






PostPosted: Tue Apr 16, 2002 2:16 am    Post subject: Re: Apache, PHP, mySQL Reply with quote

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
n00b


Joined: 15 Apr 2002
Posts: 55
Location: Australia

PostPosted: Tue Apr 16, 2002 4:56 am    Post subject: Reply with quote

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
View user's profile Send private message
Guzz
n00b
n00b


Joined: 16 Apr 2002
Posts: 25
Location: Sweden

PostPosted: Tue Apr 16, 2002 7:42 am    Post subject: Reply with quote

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
View user's profile Send private message
Guzz
n00b
n00b


Joined: 16 Apr 2002
Posts: 25
Location: Sweden

PostPosted: Tue Apr 16, 2002 9:43 am    Post subject: Reply with quote

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
View user's profile Send private message
Belg
Guest





PostPosted: Tue Apr 16, 2002 1:45 pm    Post subject: Mysql Reply with quote

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
n00b


Joined: 16 Apr 2002
Posts: 8

PostPosted: Wed Apr 17, 2002 12:24 am    Post subject: Reply with quote

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
View user's profile Send private message
KraGorn
n00b
n00b


Joined: 17 Apr 2002
Posts: 40
Location: Warrington, England

PostPosted: Wed Apr 17, 2002 7:51 am    Post subject: Reply with quote

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
View user's profile Send private message
dacoval
n00b
n00b


Joined: 17 Apr 2002
Posts: 6
Location: Qld, Australia

PostPosted: Wed Apr 17, 2002 10:16 am    Post subject: Reply with quote

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
View user's profile Send private message
eyevee99
Apprentice
Apprentice


Joined: 16 Apr 2002
Posts: 239

PostPosted: Sat Oct 19, 2002 5:00 am    Post subject: Reply with quote

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
View user's profile Send private message
eyevee99
Apprentice
Apprentice


Joined: 16 Apr 2002
Posts: 239

PostPosted: Sat Oct 19, 2002 5:12 am    Post subject: Reply with quote

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
View user's profile Send private message
eyevee99
Apprentice
Apprentice


Joined: 16 Apr 2002
Posts: 239

PostPosted: Sat Oct 19, 2002 5:41 am    Post subject: Reply with quote

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
View user's profile Send private message
lostinlinux
Guru
Guru


Joined: 05 Oct 2002
Posts: 341

PostPosted: Wed Jan 08, 2003 1:48 am    Post subject: Reply with quote

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
View user's profile Send private message
sariabod
n00b
n00b


Joined: 21 Aug 2002
Posts: 5

PostPosted: Thu Jan 09, 2003 7:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
Dragon561
Tux's lil' helper
Tux's lil' helper


Joined: 25 Oct 2002
Posts: 112

PostPosted: Sat Jun 21, 2003 7:42 pm    Post subject: Reply with quote

Yea that still didn't work for me either.
Back to top
View user's profile Send private message
psoutham
n00b
n00b


Joined: 22 Jun 2003
Posts: 2
Location: California

PostPosted: Sun Jun 22, 2003 10:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
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