FedoraThis forum is for the discussion of the Fedora Project.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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. : )
; 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 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.
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.
* 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!
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 ...
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
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.
Distribution: Server Application of Fedora 7 (at the moment), I have played with many others however.
Posts: 27
Rep:
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.