LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 04-12-2005, 08:34 AM   #1
laserbeamninja
LQ Newbie
 
Registered: Apr 2005
Posts: 14

Rep: Reputation: 0
No php_mysql in Fedora? [SOLVED]


Hello.

I've been working on this project which just PHP and MySQL. Unfortunately, the version of Fedora that someone installed for me at this job site does not seem to have php_mysql. I've been trying to install it, but I must confess that I have never needed to do this before. Can someone please help me figure out how this can be done?

It's Fedora 3, PHP 4.3.10, MySQL 3.23. For some reason I guess the php_mysql extension is not included in the default install. I appreciate the help.

— C

Last edited by laserbeamninja; 04-13-2005 at 04:17 PM.
 
Old 04-12-2005, 12:26 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Welcome to LQ.

How were php and mysql installed?
 
Old 04-12-2005, 01:18 PM   #3
deoren
Member
 
Registered: Oct 2003
Location: USA
Distribution: Ubuntu
Posts: 216

Rep: Reputation: 30
PHP Code:
<?php
phpinfo
();
?>
That will show you what support has been compiled in. It may be that it has support but has been made into a module.

Also, give us a listing of what rpms you have installed:

Code:
rpm -qa | grep [pP][hH][pP]
 
Old 04-12-2005, 01:45 PM   #4
laserbeamninja
LQ Newbie
 
Registered: Apr 2005
Posts: 14

Original Poster
Rep: Reputation: 0
I've solved this problem. No, I didn't have php_mysql installed. But I didn't configure this server, and the guy who did said he can barely spell PHP.

Next thing: Where do php error logs usually end up? I cannot get any output for my errors which makes developing anything ridiculously difficult. (Impossible.) What I can say is that if I miss my deadline today, I have an excellent excuse: I don't configure servers. : )

Thanks for any help.
 
Old 04-12-2005, 01:52 PM   #5
deoren
Member
 
Registered: Oct 2003
Location: USA
Distribution: Ubuntu
Posts: 216

Rep: Reputation: 30
Error control for php is set in php.ini

I think FC3 keeps it at /etc/php.ini. If not,
Code:
locate php.ini
or
Code:
find / | grep php.ini
will find it for you.

This is in my php.ini file:

Quote:
; Print out errors (as a part of the output). For production web sites,
; you're strongly encouraged to turn this feature off, and use error logging
; instead (see below). Keeping display_errors enabled on a production web site
; may reveal security information to end users, such as file paths on your Web
; server, your database schema or other information.
display_errors = Off

; Even when display_errors is on, errors that occur during PHP's startup
; sequence are not displayed. It's strongly recommended to keep
; display_startup_errors off, except for when debugging.
display_startup_errors = Off

; Log errors into a log file (server-specific log, stderr, or error_log (below))
; As stated above, you're strongly advised to use error logging in place of
; error displaying on production web sites.
log_errors = On

; Set maximum length of log_errors. In error_log information about the source is
; added. The default is 1024 and 0 allows to not apply any maximum length at all.
log_errors_max_len = 1024

; Do not log repeated messages. Repeated errors must occur in same file on same
; line until ignore_repeated_source is set true.
ignore_repeated_errors = Off

; Ignore source of message when ignoring repeated messages. When this setting
; is On you will not log errors with repeated messages from different files or
; sourcelines.
ignore_repeated_source = Off

; If this parameter is set to Off, then memory leaks will not be shown (on
; stdout or in the log). This has only effect in a debug compile, and if
; error reporting includes E_WARNING in the allowed list
report_memleaks = On

; Store the last error/warning message in $php_errormsg (boolean).
track_errors = Off

; Disable the inclusion of HTML tags in error messages.
;html_errors = Off

; If html_errors is set On PHP produces clickable error messages that direct
; to a page describing the error or function causing the error in detail.
; You can download a copy of the PHP manual from http://www.php.net/docs.php
; and change docref_root to the base URL of your local copy including the
; leading '/'. You must also specify the file extension being used including
; the dot.
;docref_root = "/phpmanual/"
;docref_ext = .html

; String to output before an error message.
;error_prepend_string = "<font color=ff0000>"

; String to output after an error message.
;error_append_string = "</font>"

; Log errors to specified file.
;error_log = filename
error_log = /var/log/php-errors.log

; Log errors to syslog (Event Log on NT, not valid in Windows 95).
;error_log = syslog
As you can probably tell I have errors off for display but on for logging. There are several options there that you can tweak to get the results you're looking for.
 
Old 04-12-2005, 02:05 PM   #6
laserbeamninja
LQ Newbie
 
Registered: Apr 2005
Posts: 14

Original Poster
Rep: Reputation: 0
Yes, that's the problem. I didn't have an error_log parameter. Does it hurt to put quotes around that? I ask because I don't have root access to this server (which sux) so I have to have this other fellow do all the changes, and I don't want to annoy him too much.

Thanks for the great advice.
 
Old 04-12-2005, 02:55 PM   #7
deoren
Member
 
Registered: Oct 2003
Location: USA
Distribution: Ubuntu
Posts: 216

Rep: Reputation: 30
You're welcome.

As far as quotes go, I copied that straight out of my php.ini file so it should also work for you. It was a modified copy of my FC1 php.ini file.

If you think he may have problems, direct him to this thread and we'll help him out.
 
Old 04-12-2005, 06:14 PM   #8
laserbeamninja
LQ Newbie
 
Registered: Apr 2005
Posts: 14

Original Poster
Rep: Reputation: 0
God this is frustrating

I've spent too many hours on this puzzle now. I've got a million better things to do than configure Fedora!

So here's where I'm at:

* Got sudo privs for the server.

* Here are my rpms
Code:
$> rpm -qa | grep [pP][hH][pP]
php-mysql-4.3.10-3.2
php-pear-4.3.10-3.2
php-ldap-4.3.10-3.2
php-4.3.10-3.2
* In my php.ini I have: (I've removed the comments for readability.)
Code:
error_reporting  =  E_ALL


display_errors = On


display_startup_errors = Off


log_errors = On


log_errors_max_len = 1024


ignore_repeated_errors = Off


ignore_repeated_source = Off


report_memleaks = On

track_errors = Off

error_log = /var/log/php_error.log
* I created a file called /var/log/php_error.log chmod 644 owner root

* Not only does PHP not display errors, it does not log them either!

* The result: broken code that leaves me no idea as to why it's broken!

Please help! Thanks.
 
Old 04-12-2005, 07:18 PM   #9
deoren
Member
 
Registered: Oct 2003
Location: USA
Distribution: Ubuntu
Posts: 216

Rep: Reputation: 30
Here are some results of testing for you:

Created the file like you did: Your results

Created the file like so:
Code:
touch /var/log/php-errors.log
chown apache /var/log/php-errors.log
Works fine.

Apache needs write access to the log file in order to log to it. I found that out when I moved a production system from Fedora Core 1 to Gentoo.

See if that solves your problem.

If it's a system that is not accessible to the Internet I'd suggest turning on errors in both places to speed up development. I keep a box with error logging enabled for testing so I can see the errors in a browser.

Much faster for me than Alt-Tab'ing to a terminal which is busy with
Code:
tail -f /var/log/php-errors.log
.

Though if you had a monitor attached to the system with that command running sitting by you ...
 
Old 04-12-2005, 08:03 PM   #10
laserbeamninja
LQ Newbie
 
Registered: Apr 2005
Posts: 14

Original Poster
Rep: Reputation: 0
Okay, not yet...

Thank you deoren

So now I have a log file, just like yours, created via the method you prescribed. Still nothing. Adjusted the name (I didn't think that had anything to do with it) and that was a no-go to. Now I have a log file owned by apache in the group root. Where else do I try looking. I've looked through the php.ini file a thousand times, I'm sure permissions are set, and I have a script specially written to bomb and send back errors, and none are flowing anywhere.

God willing, this problem will not keep me up all night.
Christopher
 
Old 04-12-2005, 10:16 PM   #11
deoren
Member
 
Registered: Oct 2003
Location: USA
Distribution: Ubuntu
Posts: 216

Rep: Reputation: 30
Try restarting Apache and see what the results are.

Also, provide the following if you would

results of:
Code:
find / | grep php.ini
results of:
Code:
ps aux | grep apache
results of:
Code:
ls -l /var/log/php-errors.log
Perhaps email me the results of http://YOURSITE/phpinfo.php (where phpinfo.php contains phpinfo();)

I won't be up again for about 8 hours, but I'll take another look to see if anything is working out for you.
 
Old 04-12-2005, 10:29 PM   #12
laserbeamninja
LQ Newbie
 
Registered: Apr 2005
Posts: 14

Original Poster
Rep: Reputation: 0
Sloooooooow prooooooogreeeeeeeeessssssssss

What I learned a few minutes ago is that if I run my specifically error-causing script from the command line, I do get errors back. Now I'm wondering if it is not working because I do not have php-sockets installed, but that wouldn't acount for the logging not working. I checked out httpd.conf. Nothing abnormal there, at least not on first glance. I'll email you phpinfo(). Listen, I really appreciate the help. It's been great having someone take my problem so seriously, and I feel like I've got a new friend out of the deal, for whatever duration.

— C

Code:
$> find / | grep php.ini
/etc/php.ini
/etc/.php.ini.swp
/var/tmp/php.ini.swp

$> ps aux | grep apache
apache    9351  0.0  2.5 19936 13276 ?       S    Apr10   0:03 /usr/sbin/httpd
apache    9352  0.0  2.5 19804 13112 ?       S    Apr10   0:03 /usr/sbin/httpd
apache    9353  0.0  2.5 19632 12960 ?       S    Apr10   0:03 /usr/sbin/httpd
apache    9354  0.0  2.5 19932 13332 ?       S    Apr10   0:03 /usr/sbin/httpd
apache    9355  0.0  2.5 19612 12932 ?       S    Apr10   0:03 /usr/sbin/httpd
apache    9356  0.0  2.5 19892 13224 ?       S    Apr10   0:03 /usr/sbin/httpd
apache    9357  0.0  2.5 19632 12944 ?       S    Apr10   0:03 /usr/sbin/httpd
apache    9358  0.0  2.5 19872 13224 ?       S    Apr10   0:04 /usr/sbin/httpd
apache   27879  0.0  2.5 19588 12912 ?       S    09:37   0:02 /usr/sbin/httpd
chris    29729  0.0  0.1  5608  652 pts/0    R+   20:23   0:00 grep apache

$> ls -l /var/log/php-errors.log
-rw-rw-r--  1 apache apache 0 Apr 12 17:48 /var/log/php-errors.log
 
Old 04-12-2005, 10:44 PM   #13
laserbeamninja
LQ Newbie
 
Registered: Apr 2005
Posts: 14

Original Poster
Rep: Reputation: 0
Can't email you

Don't have your email.
 
Old 04-12-2005, 11:58 PM   #14
PensJunkie
LQ Newbie
 
Registered: Jan 2005
Distribution: Server Application of Fedora 7 (at the moment), I have played with many others however.
Posts: 27

Rep: Reputation: 15
try looking at my professor's site on how to do this, i think your problem my lie at number 9 on the list. Also, if my memory serves me correctly, the owner should be root and the group apache.

Here is the page I was referring to:
http://heron.snell.clarkson.edu/~hor...44/mysql3.html

If you can't figure it out from there, check his site for more information, because I know we did this in class a while ago:
http://heron.snell.clarkson.edu/~hor...44/search1.cgi
 
Old 04-13-2005, 06:03 AM   #15
deoren
Member
 
Registered: Oct 2003
Location: USA
Distribution: Ubuntu
Posts: 216

Rep: Reputation: 30
http://heron.snell.clarkson.edu/~hor...pdata.html-php

That link may be relevant.

From that site:

Quote:
Writing a datafile in PHP introduces security problems. The following procedure shows you how to minimize such problems. It does not eliminate them entirely.
Procedure: Writing a Data File

When your PHP file runs on a browser, it is run as the web server/user apache. To enable apache to write in a directory you must give group ownership to apache. And to do this you must be in group apache. Therefore, you have all been made members of group apache. As a member of group apache you have the power to perform the followin steps

1. Change to your PHP directory: cd ~USERNAME/public_html/tc414/php
2. mkdir data
3. chgrp apache data/ Note: only the directory we are writing to needs to be in group apache. Do not put your PHP diretory in group apache.
4. chmod 0775 data/ This gives group permissions to write files to the directory.
5. ls -l Check to see the group and file permissions of directory php. Notice that data/ how different.
6. Change the path of your PHP file to write its datafile in the subdirectory data. The appropriate line might look something like this:

$file="data/form4.data"

7. Run your php program (survey4.html - survey4.data) from the browser
8. From the command line enter ls -l data/ to see that the file has been made. Notice that apache is the name for both user and group of the data file.
Now why you have to go through that trouble I don't know. That would almost suggest that apache would need write access directly to /var/log/ which I've not given it in the past (and still managed to have it write to /var/log/php-errors.log.

As far as it needing to be owned by root or apache and what group, that depends on how the permissions are set.

You can have 0700 with ownership of apache:root (user:group) or 0770 and root:apache.

It shouldn't matter.

I may look around and see if I still have a copy of FC3 so I can test this setup.
 
  


Reply



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
Fedora core fedora device /dev/dsp can't be opened J3N7iL Linux - Hardware 3 06-30-2005 03:10 PM
Will the Fedora Foundation be paying for the Linux Distribution, Fedora forum at LQ? t3gah Fedora 1 06-06-2005 06:44 AM
http://download.fedora.us/fedora/fedora/3/i386/RPMS.os broken! caps_phisto Fedora 3 02-05-2005 04:16 PM
Cannot select Fedora 2 on Fedora 2 and Windows XP Dual Boot RThomson Fedora - Installation 6 11-05-2004 08:49 PM
Fedora on gateway solo 9550 se and can fedora mt a firewire hardisk ljrose Linux - Newbie 1 08-18-2004 06:43 PM

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

All times are GMT -5. The time now is 06:49 AM.

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