[PHP] Random "open_basedir" errors
I'm using PHP 4.2.3, Apache 1.2.24 on OpenBSD 3.1. (http://ardvark.upnix.net/phpinfo.php) I'm running a fairly busy server that has a number of virtual hosts. Safe mode is off, I don't (and never did) use open_basedir anywhere and my php.ini file is the default one (untouched) from my PHP install. At random times a PHP will give the error: Warning: open_basedir restriction in effect. File is in wrong directory in Unknown on line 0 Warning: Failed opening '/php/page/I/happen/to/be/looking/at.php' for inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0 A simple hit of the reload button will make it go away. This error has showed up on every kind of page. From a Squirrel Mail page, to simple php_info() page. Now, that being said, I'm certainly not the only person with this problem. I see it in the mailing lists with no responses, and there have been a few bug reports, which have been closed or dismissed as "Bogus" (which is concerning in itself) http://bugs.php.net/bug.php?id=15302 http://bugs.php.net/bug.php?id=12995 So I'm in need of a little help here. If I've done something obviously wrong, please point it out. If you've also had this problem, I'd appreciate you sharing it. But I'm running a setup that hasn't changed -at all- for months and this is an error that's just popped up today. Thanks, Chris -- Chris Cameron UpNIX Internet Administrator ardvark.upnix.net bitbucket.upnix.net -- http://www.upnix.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Doing simple math
I'm having a problem I don't think I should be having. Basically, I'm doing some simple math, and I'm having issues in making PHP do it (with the brackets in particular). An example that looks like it -should- work: $Math = sqrt(81)(5+4)-1; Well of course that doesn't work because of the (I believe) brackets. I'm unable to think of any easy alternative that wouldn't make reading/writing these things terribly messy/hard. The above examples I just pulled out of the air, but I need to deal with many groupings with brackets, various functions (pow() and sqrt() mostly) and basic addition and subtraction, which adds a greater complexity. Have I missed something obvious? Or am I doomed to do a bunch of smaller math things so that I can do these bigger ones? Thanks, Chris -- Chris Cameron UpNIX Internet Administrator ardvark.upnix.net bitbucket.upnix.net -- http://www.upnix.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Doing simple math
On Tue, 2003-06-03 at 20:59, Lars Torben Wilson wrote: > On Tue, 2003-06-03 at 19:49, Chris Cameron wrote: > > > > An example that looks like it -should- work: > > > > $Math = sqrt(81)(5+4)-1; > > > What is the relation between the sqrt(81) and the (5+4)-1? i.e. there > is no operator there...which operator *should* be there? > Hmm, I'm thinking multiplication. It's been a while since I've been in a classroom, but "9(9)" would mean '81' to me. Although it's looking as though PHP doesn't do things like that. Being able to do that though really "cleans" things up for me though. > > Torben > > > Thanks, > > Chris > > > > -- > > Chris Cameron > > UpNIX Internet Administrator > > ardvark.upnix.net > > bitbucket.upnix.net > > -- > > http://www.upnix.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sprintf()'s in if()'s
I suppose when you have so few problems you get to nitpick.. Guess my question is; why doesn't this work? if(sprintf("%01.2f",$Result[CurrentPrice]+$Result[Increment]) <= sprintf("%01.2f",$BidAmt)) { when this works; if(0.30 <= 1.00) { I'll just settle with a workaround for now. Thanks, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] File upload !!!!
Unless you're using PHP3, I'd try using $HTTP_POST_FILES variable as suggested in http://www.php.net/manual/en/features.file-upload.php. Chris -- "... perhaps yer just such a man you put an embarasing fire in her loins" - Noah A. On Sun, 13 May 2001, Matthias Roggendorf wrote: > Hi, > sorry for asking such easy things but I really have a hard time to get this > to work: > > I use exactly the scripts which are given on the PHP website to upload > files. The problem is that the variable $userfile just contains "none" and > $userfile_size is "0". The rest of the variables have the right values. > When I use a larger file it takes more time so I assume that the file is > uploaded, but I cannot save it because I don't know the temporary filename. > > Can anybody help me? I really need this to work. > > Thanks, Matthias > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] 4.2.0 release and bug #15983
I was wondering if anyone could tell me if bug #15983 has been fixed in this new PHP release. I'd check myself, but I'm a bit short on time (thanks to this very bug). http://bugs.php.net/bug.php?id=15983 Specifically. If ever there was a more maddening bug to run across.. Thanks, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail() and a Data format error
My setup is PHP 4.0.4p1 with Apache 1.3.19 (PHP as a module), and sendmail at /usr/sbin/sendmail. I have sendmail_path = /usr/sbin/sendmail -t -i in my php.ini. THis is all on Linux. When I use mail() in any which way, it returns as if it were sucsessful, but in my maillog I see; Mar 31 16:22:16 catsnip sendmail[30912]: f2VNMGZ30910: f2VNMGY30912: DSN: Data format error The messages above it gives me the idea that it's the destination mailserver returning this error. Any ideas? Thanks, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] mysql_free_result() question
I'm a bit unclear as to which result it is I use this function on. So lets say I; $Query = mysql_query("SELECT something FROM here"); $Result = mysql_fetch_assoc($Query); Do I mysql_free_result the $Query or the $Result? If it's $Result, would this be the same as just going unset($Result)? Thanks, Chris -- "If you don't find it in the index, look very carefully through the entire catalogue." - Sears, Roebuck, and Co., Consumer's Guide, 1897 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Fatal Execution Error
I'm getting quite the whacked out error when trying to run this one php file. FATAL: erealloc(): Unable to allocate 15728640 bytes When trying to load it as a webpage I get: Alert!: Unexpected network read error; connection aborted. from lynx. When running the file from the command line with php, I get the first error. Any ideas? At all? Thanks, Chris -- "If you don't find it in the index, look very carefully through the entire catalogue." - Sears, Roebuck, and Co., Consumer's Guide, 1897 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Fatal Execution Error
I've spent a bit of time on it, and it looks to me that I've gotten an infinite loop going in a database query. I'm not certain, as something else has come up, and it's something I'll have to get back to (hopefully today). This may or may not have been the case with yours. I'll let you know what I find. Chris On Sun, 1 Jul 2001, Aral Balkan wrote: > Are you doing a database query by chance or anything with sessions? I'm > getting the same errors logged in the Apache logs for something I'm working > on (see my previous posts for details.) > > Aral :) > __ > ([EMAIL PROTECTED]) > New Media Producer, Kismia, Inc. > ([EMAIL PROTECTED]) > Adj. Prof., American University > ¯¯ > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] open_basedir and safemode-ish things
I looked through the archives, and tried finding info in the PHP manual, but haven't had much luck. I'm looking for a way to restrict virtual host users to their specific little directory by putting a thing in my httpd.conf. It looked like open_basedir should do the trick, but it didn't, and obviously something's not quite right. My php.ini has: safe_mode = off safe_mode_exec_dir = for safe mode stuff, while in a virtual host spot in my httpd.conf I have php_admin_value open_basedir /home/www/chris/www This doesn't work. If anyone could let me know the proper format this is suppose to take, I'd be most appreciative. Thanks, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP Script causing recursive free() calls (?)
I was told this was a PHP problem, and to submit a bug report. I'm not too sure what such a bug report would look like, or even if this is a PHP problem. Below is the message I sent to an Apache list, could someone tell me whether my problem is crummy code, or an actual problem with PHP/Apache? Thanks Chris -Original Message- From: Chris Cameron [mailto:[EMAIL PROTECTED]] Sent: Friday, August 10, 2001 12:40 PM To: [EMAIL PROTECTED] Subject: PHP Script causing recursive free() calls (?) I've got quite a problem with part of a PHP script I wrote causing Apache too fill up it's error logs with: httpd in free(): warning: chunk is already free. httpd in free(): warning: chunk is already free. httpd in malloc(): warning: recursive call. FATAL: emalloc(): Unable to allocate 256 bytes Each call of this script will put about 20 megs in my error log. My Apache setup is: Apache/1.3.20 (Unix) mod_ssl/2.8.4 OpenSSL/0.9.6b PHP/4.0.6 And my phpinfo page is at chris.upnix.com/index.php The part of my PHP script that's causing the problem (sorry about the wraping): /* If no errors, submit junk to database */ if(!isset($Error)) { for($i = 1; $i <= $Days; $i++) { /* Write to bookings first */ $QueryString = "INSERT INTO bookings VALUES(nextval('BID'), '$CompanyID', '" . $TimeSpan[$i] . "', '$TimeF', '$TimeT', '$PricePerUnit')"; $Query = pg_exec($Connect, $QueryString); $OID = pg_getlastoid($Query); /* Find the BID we were given */ $QueryString = "SELECT bid FROM bookings WHERE oid = '" . $OID . "'"; $Query = pg_exec($Connect, $QueryString); $Result = pg_fetch_array($Query, 0); $BID = $Result['bid']; /* Go through our therapists */ foreach($Therapists[$i] as $Key => $TherapistID) { $QueryString = "INSERT INTO bookedtherapist VALUES('" . $BID . "', '$TherapistID', '$TimeF', '$TimeT')"; pg_exec($Connect, $QueryString); } } /* Everything Should be done, send us off to schview.php */ header("Location: " . $BaseURL . "admin/schview.php"); exit; } I've tried rewriting little parts of this script, but haven't had any luck in stopping the errors. Also, I've recompiled everything twice now, which also didn't help. Any help would be appreciated. Thanks, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Sessions in pop-up windows
I'm having some issues passing a session to a pop-up window. The pop-up window is you average DreamWeaver popup: Link When you click on the link, the session doesn't get passed. I have trans-sid enabled. Any ideas on how I could go about passing my sid? Thanks, Chris -- Chris Cameron System Administrator UpNIX Internet Services http://www.upnix.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]