LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-16-2005, 06:29 PM   #1
IssacT
LQ Newbie
 
Registered: Aug 2005
Location: Connecticut
Distribution: Fedora 12
Posts: 18

Rep: Reputation: 0
Troubleshooting apache, php, and mysql.


Heya everyone. Name's Steve, and I had recently installed slack, switching over from FreeBSD. When I set up BSD, I followed tutorials the whole way through and barely made it to a working server. I used their ports system most of the time.

Now, here I am, new to Linux. It has been a learning process thus far, but now I'm stuck in a rut with troubleshooting between the big three.

Just to let you know, this is what I prefer and use:
Apache 1.3
MySQL 4.x
PHP 4.x (Should I switch to 5? Are there any major reasons to?)

Now, I'm pretty sure I have all the configuration right. Well, obviously I don't if it isn't working. =P

All three are installed from the slack CD. I went through httpd.conf and uncommented the Include for mod_php.conf. In php.ini, the extension directed to MySQL is active. MySQL is installed and working.

I created a file, phpinfo.php:
<?php
phpinfo();
?>

When I view this, nothing displays. Just a blank page. So obviously something is borked.

What I am asking is for things that I could check that could lead me in the right direction. Many things can cause this, I know, but what are the most common? Where can I look, and what should I do?

My sincere thanks to all help.
 
Old 08-16-2005, 06:52 PM   #2
raska
Member
 
Registered: Aug 2004
Location: Aguascalientes, AGS. Mexico.
Distribution: Slackware 13.0 kernel 2.6.29.6
Posts: 816

Rep: Reputation: 31
Hi buddy, welcome to slack

I'm NOT like a webdev guru or something like that... but I think the problem might be the location of your "phpinfo.php" file (the code is ok). I think it must be inside your wwwroot or whatever you set it in the httpd.conf. Also enabling .php extentions in that file might help, so you can use index.php files as the default ones in your directories, if you didn't do that.

It isn't that hard... if you managed set up MySQL, it's easier to set up php... it's almost automatic.

Peace.
 
Old 08-16-2005, 07:11 PM   #3
IssacT
LQ Newbie
 
Registered: Aug 2005
Location: Connecticut
Distribution: Fedora 12
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by raska
Hi buddy, welcome to slack

I'm NOT like a webdev guru or something like that... but I think the problem might be the location of your "phpinfo.php" file (the code is ok). I think it must be inside your wwwroot or whatever you set it in the httpd.conf. Also enabling .php extentions in that file might help, so you can use index.php files as the default ones in your directories, if you didn't do that.

It isn't that hard... if you managed set up MySQL, it's easier to set up php... it's almost automatic.

Peace.
Nah, that isn't it. My webroot is /usr/www and I have Virtual Hosts set up for pretty much everything. I know this because if you go to tiranepar(dot)com, you'll see a site working just fine. Well, almost just fine- The PHP scripts aren't working. tiranepar(dot)com is the root for tiranepar, located in /usr/www/tiranepar.com/root/

izzy(dot)tiranepar(dot)com is my blog, and you'll notice the PHP scripts are borked there, too.

tiranepar(dot)com/phpinfo.php contains the phpinfo script. Take a look if you want.

Sorry for the (dot)'s. Under 5 posts, no links... You know the drill.

Thanks for the input, though. =D

Last edited by IssacT; 08-16-2005 at 07:15 PM.
 
Old 08-16-2005, 09:53 PM   #4
LiNuCe
Member
 
Registered: Apr 2004
Location: France
Distribution: Slackware Linux 10.2
Posts: 119

Rep: Reputation: 15
Re: Troubleshooting apache, php, and mysql.

Quote:
IssacT wrote :
(...) I created a file, phpinfo.php:
<?php
phpinfo();
?>

When I view this, nothing displays. Just a blank page. So obviously something is borked. (...)
Did you look for error messages in Apache's error log file (/var/log/apache/error_log) ? You will probably find useful informations.

-- LiNuCe
 
Old 08-17-2005, 01:45 AM   #5
DaHammer
Member
 
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
I'm not sure what you added/uncommented in your httpd.conf but it takes more than 1 line to get php going. Have a look at http://www.php.net/manual/en/install...l.unix.apache. But basically, you'll need these 3 or some deritive of them:
Code:
LoadModule php4_module libexec/libphp4.so
AddModule mod_php4.c
AddType application/x-httpd-php .php
The first 1 only if php is added as a module vs compiled in, which best I recall it is in the Slack packages.
 
Old 08-17-2005, 08:52 AM   #6
IssacT
LQ Newbie
 
Registered: Aug 2005
Location: Connecticut
Distribution: Fedora 12
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by DaHammer
I'm not sure what you added/uncommented in your httpd.conf but it takes more than 1 line to get php going. Have a look at http://www.php.net/manual/en/install...l.unix.apache. But basically, you'll need these 3 or some deritive of them:
Code:
LoadModule php4_module libexec/libphp4.so
AddModule mod_php4.c
AddType application/x-httpd-php .php
The first 1 only if php is added as a module vs compiled in, which best I recall it is in the Slack packages.

These are all satisfied except AddModule, and if I try to add AddModule mod_php4.c to mod_php.conf, it spits out an error on httpd startup. But right now I have more than a blank page. This is what I get on phpinfo.php:

Quote:
Warning: Unknown(/usr/www/tiranepar.com/root/phpinfo.php): failed to open stream: Permission denied in Unknown on line 0

Warning: (null)(): Failed opening '/usr/www/tiranepar.com/root/phpinfo.php' for inclusion (include_path='.:/usr/lib/php') in Unknown on line 0
Could this be a problem with permissions?
Another one that's odd:

Quote:
Fatal error: Call to undefined function: mysql_connect() in /usr/www/tiranepar.com/sub/izzy/src/page/blog.php
We all know that mysql_connect() is a valid function. Why would PHP be severed from its packaged functions? Bleh.

Last edited by IssacT; 08-17-2005 at 09:05 AM.
 
Old 08-17-2005, 09:27 AM   #7
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
If you run this command in a terminal :
Code:
php -r 'mysql_connect();'
does it output an error ?

Also you may check /usr/www and all subdir permissions to see if there
are readable by everyone.

Does this command work in a terminal :
Code:
php -r 'phpinfo();'
 
Old 08-17-2005, 09:36 AM   #8
IssacT
LQ Newbie
 
Registered: Aug 2005
Location: Connecticut
Distribution: Fedora 12
Posts: 18

Original Poster
Rep: Reputation: 0
On mysql_connect:

Quote:
PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php/extensions/mysql.so' - libmysqlclient.so.12: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Fatal error: Call to undefined function: mysql_connect() in Command line code on line 1

Fatal error: Call to undefined function: mysql_connect() in Command line code on line 1
However, phpinfo works. Would you like a log?
 
Old 08-17-2005, 09:39 AM   #9
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
No, it was for checking if phpinfo() function was available.

Could you check the existence of mysql.so file ?
Code:
ls -l /usr/lib/php/extensions/mysql.so
 
Old 08-17-2005, 09:45 AM   #10
IssacT
LQ Newbie
 
Registered: Aug 2005
Location: Connecticut
Distribution: Fedora 12
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
-rwxr-xr-x 1 root root 41780 2004-12-21 18:11 /usr/lib/php/extensions/mysql.so
It is linked in php.ini, as well.
 
Old 08-17-2005, 09:55 AM   #11
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Could you post the output with :
Code:
ldd /usr/lib/php/extensions/mysql.so | grep mysql
 
Old 08-17-2005, 09:57 AM   #12
IssacT
LQ Newbie
 
Registered: Aug 2005
Location: Connecticut
Distribution: Fedora 12
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
ldd /usr/lib/php/extensions/mysql.so | grep mysql
libmysqlclient.so.12 => not found
Okay, here is when I get clueless. I really do appreciate this, you know. =D
 
Old 08-17-2005, 10:00 AM   #13
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
We get close

Now post the output with :
Code:
ls -l /usr/lib/mysql/*.so
And :
Code:
ls -l /usr/lib/libmysqlclient*
 
Old 08-17-2005, 10:07 AM   #14
IssacT
LQ Newbie
 
Registered: Aug 2005
Location: Connecticut
Distribution: Fedora 12
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
ls -l /usr/lib/mysql/*.so
lrwxrwxrwx 1 root root 24 2005-08-16 12:42 /usr/lib/mysql/libmysqlclient.so -> libmysqlclient.so.14.0.0
lrwxrwxrwx 1 root root 26 2005-08-16 12:42 /usr/lib/mysql/libmysqlclient_r.so -> libmysqlclient_r.so.14.0.0

Quote:
ls -l /usr/lib/libmysqlclient*
lrwxrwxrwx 1 root root 23 2005-08-16 12:42 /usr/lib/libmysqlclient.so -> mysql/libmysqlclient.so
lrwxrwxrwx 1 root root 26 2005-08-16 12:42 /usr/lib/libmysqlclient.so.14 -> mysql/libmysqlclient.so.14
lrwxrwxrwx 1 root root 25 2005-08-16 12:42 /usr/lib/libmysqlclient_r.so -> mysql/libmysqlclient_r.so
lrwxrwxrwx 1 root root 28 2005-08-16 12:42 /usr/lib/libmysqlclient_r.so.14 -> mysql/libmysqlclient_r.so.14
 
Old 08-17-2005, 10:13 AM   #15
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Ok, you have incompatible php and mysql packages

You have to upgrade php package or downgrade mysql package
(the better is to upgrade php package I think)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache/PHP/MySQL brokenflea Slackware 9 10-29-2004 12:16 AM
Apache Mysql Php: mysql with php doesn't work breakerfall Linux - Networking 6 12-27-2003 08:59 PM
Apache+Mysql+php c0c0deuz Linux - Software 0 08-14-2003 02:14 PM
php-nuke with apache php mysql c0c0deuz Linux - Software 0 03-30-2003 06:23 AM
PHP/Apache/MySQL imposter Linux - Newbie 3 12-02-2002 02:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration