Apache, PHP, MySQL and Samba

Ask questions regarding Gentoox, Gentoo and Linux in general in these forums and we'll do our best to help you!
clpalmer
Power user
Posts: 288
Joined: Sat Jan 29, 2005 6:38 pm

Post by clpalmer »

It's not working. It's displaying the contents of the script (but since it's just a few tags, it doesn't show in the browser). If you right click and save on the script, you can open it in a text editor and see that it's the script, not the output. The output of phpinfo should be a huge screen full of info on your php install.

I would assume it's apache and not your php install, but you can try this as well. Make a test.php file and put this in it:

Code: Select all

#!/usr/bin/php -q
<? echo "PHP is OK!\n"; ?>
(make sure your php is installed in /usr/bin) Then chmod 755 the script and ./ it. It should print out "PHP is OK!" if at least your php interpreter is working.

Grep (recursively) in /etc/apache2 and look for "PHP4" or "PHP5" or anything else related to php. You may find that you've got the php init stuff surrounded by an ifdef that you didn't define. Should be PHP4 (or PHP5 maybe, as vplayer said).
cheesyboofs
Power user
Posts: 239
Joined: Wed Jan 26, 2005 1:32 pm
Location: Luton UK
Contact:

Post by cheesyboofs »

Thanks for all your help,

I'm confused as arse holes, I ran your script and it did indeed report "PHP is OK!" so I Grep'ed around /etc/apache2 and there is no referance to php what so ever as stated above...

-rw-r--r-- 1 root root 3213 Jul 22 07:15 40_mod_ssl.conf
-rw-r--r-- 1 root root 8053 Jul 22 07:15 41_mod_ssl.default-vhost.conf
-rw-r--r-- 1 root root 583 Jul 22 07:15 45_mod_dav.conf
-rw-r--r-- 1 root root 902 Jul 22 07:15 46_mod_ldap.conf

I'm confused!
Go fully native, it's the destiny of all Mk1 XboxesImage
The needs of the many out way the needs of the few or the one ...
clpalmer
Power user
Posts: 288
Joined: Sat Jan 29, 2005 6:38 pm

Post by clpalmer »

did you emerge mod_php?
Zombie13
Linux User
Posts: 19
Joined: Tue Nov 04, 2003 8:35 pm
Location: United Kingdom

Post by Zombie13 »

Just to clarify, I had to add the following lines to "/etc/apache2/conf/apache2.conf" (if I remember correctly, it was a few weeks ago now...)

LoadModule php4_module extramodules/libphp4.so
AddType application/x-httpd-php .php

:)

EDIT: I've just had a play, and hashed out those lines from my apache config file, then restarted apache. The php code was displayed in the browser. I re-added those lines, then restarted apache, and php is displaying correctly again. Hope this helps.
cheesyboofs
Power user
Posts: 239
Joined: Wed Jan 26, 2005 1:32 pm
Location: Luton UK
Contact:

Post by cheesyboofs »

clpalmer wrote:did you emerge mod_php?
:o
Right, I added;

Code: Select all

LoadModule php4_module extramodules/libphp4.so 
AddType application/x-httpd-php .php
to "/etc/apache2/conf/apache2.conf" and I get,
Dev-bOx / # ./etc/init.d/apache2 restart
* Stopping apache2...
Syntax error on line 77 of /etc/apache2/conf/apache2.conf:
Cannot load /usr/lib/apache2/extramodules/libphp4.so into server: /usr/lib/apache2/extramodules/libphp4.so: cannot open shared object file: No such file or directory [ ok ]
* Apache2 has detected a syntax error in your configuration files:
Syntax error on line 77 of /etc/apache2/conf/apache2.conf:
Cannot load /usr/lib/apache2/extramodules/libphp4.so into server: /usr/lib/apache2/extramodules/libphp4.so: cannot open shared object file: No such file or directory
So;
Dev-bOx/ # ls /usr/lib/apache2/extramodules/
mod_ssl.so

From this I deduce that mod_php is not installing correctly? could I not just find the libphp4.so file on the hoola and drop it into the /usr/lib/apache2/extramodules directory?
Go fully native, it's the destiny of all Mk1 XboxesImage
The needs of the many out way the needs of the few or the one ...
Zombie13
Linux User
Posts: 19
Joined: Tue Nov 04, 2003 8:35 pm
Location: United Kingdom

Post by Zombie13 »

I'd say that you're right... php doesn't seem to be installed. I get the following...

Code: Select all

Xbox root # ls /usr/lib/apache2/extramodules/
libphp4.so  mod_ssl.so
cheesyboofs
Power user
Posts: 239
Joined: Wed Jan 26, 2005 1:32 pm
Location: Luton UK
Contact:

Post by cheesyboofs »

Well I'm gunna try a full un-emerge of both mod_php and apache the a re-emerge,

Before I do could you mail me the libphp4.so file so I can try dropping it in the directory to see if it all kicks in.

cheesyboofs'AT'ntlworld.com
Go fully native, it's the destiny of all Mk1 XboxesImage
The needs of the many out way the needs of the few or the one ...
Zombie13
Linux User
Posts: 19
Joined: Tue Nov 04, 2003 8:35 pm
Location: United Kingdom

Post by Zombie13 »

cheesyboofs
Power user
Posts: 239
Joined: Wed Jan 26, 2005 1:32 pm
Location: Luton UK
Contact:

Post by cheesyboofs »

Thanks for all your help, I've learnt allot!

I got it working by un-emerging mod_php and apache. I think the problem was I may have had both apache and apache2 installed one manually installed by me and one installed by mod_php and this was the conflict.

I just emerged mod_php on its own after a good clear out and this seems to work!

http://mail.cheesyboofs.co.uk/info/index.php

Thanks again
Go fully native, it's the destiny of all Mk1 XboxesImage
The needs of the many out way the needs of the few or the one ...
clpalmer
Power user
Posts: 288
Joined: Sat Jan 29, 2005 6:38 pm

Post by clpalmer »

Glad it's workin =)
saintmike
Linux User
Posts: 12
Joined: Tue Sep 13, 2005 10:31 pm

Post by saintmike »

Howdy, im new to gentoo but not so much to linux, been using fedora for some time now. never used emerge befor, guessing its a gentoo thing

Running the following is installing everything correct?

Code: Select all

# emerge sync && emerge -av portage mysql samba mod_php
It dosnt come up with any errors that i noticed, but i can only find apatch2, im pretty sure im not that crazy and am looking in the right spots.


i cant run any of the following, was i ment to do something after emerging...

Code: Select all

# mysql_install_db
# /etc/init.d/mysql start
> mysqladmin -u root -h Pro password 'xbox'
>mysqladmin -u root password 'xbox' -p
i have the following use set up on pro v2, would it have something to do with this?

USE="-sdl -ipv6 X -gnome -kde -gtk -cups mmx mysql apache2 alsa aalib dvd gpm mpeg oggvorbis perl png -qt quicktime samba sse truetype usb xmms"

any help would be appreciated
iamcheese
Newbie
Posts: 4
Joined: Sat Jan 08, 2005 8:23 pm

Post by iamcheese »

I get this error

Code: Select all

mysqladmin: connect to server at 'Pro' failed
error: 'Access denied for user: 'root@Pro' (Using password: NO)'
when trying to run this

Code: Select all

mysqladmin -u root -h Pro password 'xbox' 
orochi
Gentoox Guru!
Posts: 606
Joined: Sun Oct 24, 2004 8:11 am

Post by orochi »

try:

mysqladmin -u root -h 127.0.0.1 password 'xbox'

or:
mysqladmin -u root -h localhost password 'xbox'

or:
mysqladmin -u root -h <ipaddress of your xbox> password 'xbox'
clpalmer
Power user
Posts: 288
Joined: Sat Jan 29, 2005 6:38 pm

Post by clpalmer »

of course submitting your root password for xbox if you've changed it =)

... which I hope you have...
tschepsit
Newbie
Posts: 3
Joined: Wed Oct 19, 2005 12:16 am

Lost connection to MySQL server during query

Post by tschepsit »

Whenever I try to run the command
mysqladmin -u root -h localhost password 'xbox'
I get this error message
mysqladmin: connect to server at '127.0.0.1' failed
error: 'Lost connection to MySQL server during query'
This is pretty weird, I'm using a completely new install of Home 4.0, and the only configuration I've done is to change the root password and go through the steps in this tutorial. I've tried using different host names/IP addresses to no avail. /etc/hosts seems to be setup correctly, but I wouldn't expect it to matter when using the IP address anyway.

Any suggestions?
Post Reply