Re: [PHP] PHP Fatal error: Call to undefined function ()
On 7 Oct 2013, at 14:34, Michael Alaimo wrote: > On Mon, Oct 7, 2013 at 9:29 AM, Stuart Dallas wrote: >> On 7 Oct 2013, at 14:24, Michael Alaimo wrote: >> >> > We have a server that gets a large number of requests each month. >> > >> > After a period of time I began to see this error in our error logs this >> > weekend. >> > >> > PHP Fatal error: Call to undefined function () >> > >> > It does not reference a function, so I found it odd. It did give a line to >> > a function with array_merge on it. >> > >> > Has anyone seen this in the apache error logs? We are using PHP 5.3.3. >> >> Show us the line, and a few lines around it. > public static function getInfo($params = array()) > { > $results = array(); > > $url = 'http://google.com'; > > > $props = array > ( >'key'=> Yii::app()->params['param1'], > 's'=> Yii::app()->params['param2'] > ); > > if (!empty($params)) > { > $props = array_merge($props, $params); > > $url = $url . http_build_query($props, '', '/'); > > > It may be possible that params has unsafe data in it. The previous dev did > not validate the data passed in via get. > > The code populating params looks like: > > $params = array > ( > 'd' => $_GET['d'], > ); > > $job = Job::getInfo($params); My best guess is that either $props or $params contain a function reference or similar construct. Examine their contents with var_dump. As a check you could expand out the effect of array_merge and see if you still get the same with a PHP implementation. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Fatal error: Call to undefined function ()
public static function getInfo($params = array()) { $results = array(); $url = 'http://google.com'; $props = array ( 'key'=> Yii::app()->params['param1'], 's'=> Yii::app()->params['param2'] ); if (!empty($params)) { $props = array_merge($props, $params); $url = $url . http_build_query($props, '', '/'); It may be possible that params has unsafe data in it. The previous dev did not validate the data passed in via get. The code populating params looks like: $params = array ( 'd' => $_GET['d'], ); $job = Job::getInfo($params); On Mon, Oct 7, 2013 at 9:29 AM, Stuart Dallas wrote: > On 7 Oct 2013, at 14:24, Michael Alaimo wrote: > > > We have a server that gets a large number of requests each month. > > > > After a period of time I began to see this error in our error logs this > > weekend. > > > > PHP Fatal error: Call to undefined function () > > > > It does not reference a function, so I found it odd. It did give a line > to > > a function with array_merge on it. > > > > Has anyone seen this in the apache error logs? We are using PHP 5.3.3. > > Show us the line, and a few lines around it. > > -Stuart > > -- > Stuart Dallas > 3ft9 Ltd > http://3ft9.com/ >
Re: [PHP] PHP Fatal error: Call to undefined function ()
On 7 Oct 2013, at 14:24, Michael Alaimo wrote: > We have a server that gets a large number of requests each month. > > After a period of time I began to see this error in our error logs this > weekend. > > PHP Fatal error: Call to undefined function () > > It does not reference a function, so I found it odd. It did give a line to > a function with array_merge on it. > > Has anyone seen this in the apache error logs? We are using PHP 5.3.3. Show us the line, and a few lines around it. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Fatal error: Call to undefined function ()
We have a server that gets a large number of requests each month. After a period of time I began to see this error in our error logs this weekend. PHP Fatal error: Call to undefined function () It does not reference a function, so I found it odd. It did give a line to a function with array_merge on it. Has anyone seen this in the apache error logs? We are using PHP 5.3.3. Mike
RE: [PHP] PHP Fatal error: Cannot redeclare class
Thanks Louis, Worked a treat! -Original Message- From: Louis Huppenbauer [mailto:louis.huppenba...@gmail.com] Sent: 14 March 2011 15:10 To: Crowley, Brendan - Dell Team Subject: Re: [PHP] PHP Fatal error: Cannot redeclare class what about http://ch2.php.net/namespaces in php 5.3? 2011/3/14 : > Hi, I get the following error in my apache error log: > [14-Mar-2011 14:17:27] PHP Fatal error: Cannot redeclare class I > created a simplified set of php files and classes to formulate this question. > I have 5 php files; 2 of which declare a class that has the same name in > both. I know it would be very easy to change one of the class names, but I'm > restricted because I'm working with legacy working code and an interface > definition that cannot change either, here are the php files, how can I > resolve this?, any help appreciated. > Thanks, > Brendan. > > ## phpFileOne.php ## > include_once './phpFileTwo.php'; > include_once './phpFileFour.php'; > > $zIns = new Z(); > $result = a($zIns); > > // class Z is defined in phpFileFour.php function a(Z $dataX) { > $dataZ; > $dataY = b($dataZ); // b is defined in phpFileTwo.php > return $dataY; > } > > echo 'result: '.$result.''; > ?> > > ## phpFileTwo.php ## > include_once './phpFileThree.php'; > function b($dataW) { > $dataU; > $dataV = new A($dataU); // class A is defined in phpFileThree.php > return $dataV->c(); > } > ?> > > ## phpFileThree.php ## > include_once './phpFileFive.php'; > // class Z is defined in phpFileFive.php class A extends Z { > function __construct($dataM) { > > } > > function c() { > return 'cValue'; > } > } > ?> > > ## phpFileFour.php ## > // class Z defined in interface definition - cannot change name class > Z { } ?> > > ## phpFileFive.php ## > // this class and class Z in phpFileFour.php have the same name! > // Legacy class Z - cannot change name class Z { } ?> > > > > > >
Re: [PHP] PHP Fatal error: Cannot redeclare class
On Mon, Mar 14, 2011 at 10:34, wrote: > Hi, I get the following error in my apache error log: > [14-Mar-2011 14:17:27] PHP Fatal error: Cannot redeclare class > I created a simplified set of php files and classes to formulate this > question. > I have 5 php files; 2 of which declare a class that has the same name in > both. I know it would be very easy to change one of the class names, but I'm > restricted because I'm working with legacy working code and an interface > definition that cannot change either, here are the php files, how can I > resolve this?, any help appreciated. If it's legacy code and this is how it was, that means it never worked properly, because you can't redeclare classes or functions by the same name. That said, if you're restricted from changing the class names, how about wrapping the classes with a !class_exists() call? http://php.net/class_exists > ## phpFileOne.php ## > include_once './phpFileTwo.php'; > include_once './phpFileFour.php'; > > $zIns = new Z(); > $result = a($zIns); > > // class Z is defined in phpFileFour.php > function a(Z $dataX) { > $dataZ; > $dataY = b($dataZ); // b is defined in phpFileTwo.php > return $dataY; > } > > echo 'result: '.$result.''; > ?> > > ## phpFileTwo.php ## > include_once './phpFileThree.php'; > function b($dataW) { > $dataU; > $dataV = new A($dataU); // class A is defined in phpFileThree.php > return $dataV->c(); > } > ?> > > ## phpFileThree.php ## > include_once './phpFileFive.php'; > // class Z is defined in phpFileFive.php > class A extends Z { > function __construct($dataM) { > > } > > function c() { > return 'cValue'; > } > } > ?> > > ## phpFileFour.php ## > // class Z defined in interface definition - cannot change name > class Z { > } > ?> > > ## phpFileFive.php ## > // this class and class Z in phpFileFour.php have the same name! > // Legacy class Z - cannot change name > class Z { > } > ?> > > > > > > -- Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Fatal error: Cannot redeclare class
Hi, I get the following error in my apache error log: [14-Mar-2011 14:17:27] PHP Fatal error: Cannot redeclare class I created a simplified set of php files and classes to formulate this question. I have 5 php files; 2 of which declare a class that has the same name in both. I know it would be very easy to change one of the class names, but I'm restricted because I'm working with legacy working code and an interface definition that cannot change either, here are the php files, how can I resolve this?, any help appreciated. Thanks, Brendan. ## phpFileOne.php ## result: '.$result.''; ?> ## phpFileTwo.php ## c(); } ?> ## phpFileThree.php ## ## phpFileFour.php ## ## phpFileFive.php ##
[PHP] Fatal error: Allowed memory size of XXXXX bytes exhausted
Hello, I have an issu with a script launched by cron. In fact, although i setup php memory_limit to high value (1G or 2Go), i have the same issue. By example with 2G : Output from command /usr/bin/php5 -d memory_limit=2G -f /home/test/www/cron.php .. Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 266257 bytes) in /home/test/www/app/code/local/Ess/M2e/Model/M2eConnector.php on line 423 And with 1G : Output from command /usr/bin/php5 -d memory_limit=1G -f /home/test/www/cron.php .. Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 267717 bytes) in /home/test/www/app/code/local/Ess/M2e/Model/M2eConnector.php on line 423 Result is the same... Do you know why ? This is my php version : /usr/bin/php5 -v PHP 5.2.6-1+lenny4 with Suhosin-Patch 0.9.6.2 (cli) (built: Nov 22 2009 01:50:58) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies with the ionCube PHP Loader v3.3.20, Copyright (c) 2002-2010, by ionCube Ltd., and with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies On a Debian Lenny, 64 bits version. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined method
Try this: escreveu na mensagem news:29494740.p...@talk.nabble.com... > > Greetings, > > I'm having a very simple problem that I can't seem to find the solution > to. > I try and access a method in this class I made called > MyPropertyManagement... the method is named get_complexes(). I try and > strip down the entire class to just focus on this problem with the hopes > of > it making things simple enough that the error will become apparent, but > unfortunately it has not. I am able to make a new instances of this > class, > add in some other methods and run/use them just fine. For some reason > this > method keeps erroring out saying it is undefined. I don't understand why? > Can someone please shed some light on this subject please? > > The error is: "Fatal error: Call to undefined method > PropertyMgmt::get_complexes() in /usr/www/test/test2.php on line 6" > > The files are as follows: > > /*** /usr/www/test/inc/class/PropertyManagement.class.php > ***/ > > > > class PropertyMgmt > { >function PropertyMgmt() { >global $complexes; /* yes I know using globals is dangerous, I > will fix this soon! :-) */ >} > > > > > public function PropertyMgmt::get_complexes() { > /* null */ > } > > } // end class > > > > > > /*** /usr/www/test/test2.php ***/ > require_once('/usr/www/test/inc/class/PropertyMgmt.class.php'); > > > $PM = new PropertyMgmt(); > $PM->get_complexes(); > > die(); > > /* end test2.php / > > Thank you in advance... > > - > ___ > PHP 5.3.3 > Apache 1.3.37 > MySQL 5.0.24a > FreeBSD 6.2-PRERELEASE > -- > View this message in context: > http://old.nabble.com/Fatal-error%3A-Call-to-undefined-method-tp29494740p29494740.html > Sent from the PHP - General mailing list archive at Nabble.com. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fatal error: Call to undefined method
Greetings, I'm having a very simple problem that I can't seem to find the solution to. I try and access a method in this class I made called MyPropertyManagement... the method is named get_complexes(). I try and strip down the entire class to just focus on this problem with the hopes of it making things simple enough that the error will become apparent, but unfortunately it has not. I am able to make a new instances of this class, add in some other methods and run/use them just fine. For some reason this method keeps erroring out saying it is undefined. I don't understand why? Can someone please shed some light on this subject please? The error is: "Fatal error: Call to undefined method PropertyMgmt::get_complexes() in /usr/www/test/test2.php on line 6" The files are as follows: /*** /usr/www/test/inc/class/PropertyManagement.class.php ***/ get_complexes(); die(); /* end test2.php / Thank you in advance... - ___ PHP 5.3.3 Apache 1.3.37 MySQL 5.0.24a FreeBSD 6.2-PRERELEASE -- View this message in context: http://old.nabble.com/Fatal-error%3A-Call-to-undefined-method-tp29494740p29494740.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Solution: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
After trying everything everyone said in here, I finally had a clear enough head to read through my logs and both my Apache httpd.conf and my PHP6 php.ini files. I realized that in my Apache error log, it was listing the fact that PHP could not load the modules for mysqli and xmlrpc (or something like that, but the focus here is MySQL). Instead of reinstalling everything, as I'm a stubborn person, I found a line in the php.ini file that in our case probably should not be commented out. ; Directory in which the loadable extensions (modules) reside. ; http://php.net/extension-dir ; extension_dir = "./" ; On windows: ; extension_dir = "ext" That last line (for Windows), remove the semi-colon (;), and make sure the mysqli modules you need are in C:\php\ext, after doing this, my MySQL was finally able to connect with PHP. As a final note, Apache was telling me it was looking for the missing modules in C:\php6\ which is not a setting I ever set, and that directory does not exist in the php.ini or apache configuration files, so it seems to be a default directory for PHP. I did not see any benefit for cause for having an extra php.ini in a C:\php6 folder as some have suggested, so I would suggest trying to avoid that unless it turns out to be necessary. Also, some people recommended putting the required modules in multiple directories, whereas I would recommend ensuring that the original installation modules are left where they are, and if you are to make copies, try to make sure all your modules are the same versions, and that you only make additional copies to the C:\php\ext folder or Apache's own includes folder if necessary. Do not make extra copies to C:\php6 or your system32 folders - this will add clutter, and possibly cause issues in the future. I hope this helped. Just stay calm, be patient, relax - you will find the issue as long as you're clear minded and resist frustration. Have a great day. PS: I registered just so I could share this, lol. -- This message was sent on behalf of chris_br...@hotmail.com at openSubscriber.com http://www.opensubscriber.com/message/php-general@lists.php.net/11675992.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error on functions valid for PHP 4, 5 [RESOLVED]
On October 9, 2009 05:17:18 pm you wrote: > kro...@aolohr.com wrote: > > Thanks Chris. > > > > Seems like the function is a dud. I have '-enable-calendar' working on > > both local and production. Sigh . . > > > > I have been using another modified 'easter' function, 'pFeast', (can't > > for the life of me find it on the net now). It works well, but I need to > > set the output to a variable, so I can use it for other purposes. But > > that's another prob . . . > > > > Regards, > > Andree > > > > On October 9, 2009 02:46:52 pm Chris Streatfield wrote: > >> Out put on PHP 5.2.4 > >> > >> > >> Parse error: syntax error, unexpected T_STRING in /testphp.php on line 2 > >> > >> > >> Line 2 is the first line of code. > >> > >> Output on PHP 5.2.6 and on PHP 5.3.0 local > >> > >> blank page. > >> > >> All the best > >> Chris Streatfield > >> Tel: +64 4 475 7846 > >> Mob: 021 102 6018 > >> Skype: chrisstreat > >> > >> On Sat, 10 Oct 2009 02:01:24 kro...@aolohr.com wrote: > >>> Hi, > >>> > >>> Would someone be kind enough to test whether these following functions > >>> work? > >>> > >>> I'm getting: "PHP Fatal error: Call to undefined function > >> > >> easter_date() . . . > >> > >>> easter_days" on both local and production sites. > >>> > >>> > >>> >>> > >>> echo easter_days(2009); > >>> print ""; > >>> echo date("M-d-Y", easter_date(2009)); > >>> print ""; > >>> echo date("D d M Y", easter_date(2009)); > >>> > >>> ?> > >>> > >>> > >>> I'm using 5.2.10 production; PHP 5.2.4 local. > >>> > >>> Tia, > >>> Andre > >>> > >>> -- > >>> PHP General Mailing List (http://www.php.net/) > >>> To unsubscribe, visit: http://www.php.net/unsub.php > > Well, I'm not sure why you don't have the function, but if you scroll to > the bottom of http://us2.php.net/manual/en/function.easter-date.php: > > if(!function_exists('easter_date')) { > function easter_date ($Year) > { > /* > G is the Golden Number-1 > H is 23-Epact (modulo 30) > I is the number of days from 21 March to the Paschal full moon > J is the weekday for the Paschal full moon (0=Sunday, > 1=Monday, etc.) > L is the number of days from 21 March to the Sunday on or before > the Paschal full moon (a number between -6 and 28) > */ > $G = $Year % 19; > $C = (int)($Year / 100); > $H = (int)($C - (int)($C / 4) - (int)((8*$C+13) / 25) + 19*$G + > 15) % 30; > $I = (int)$H - (int)($H / 28)*(1 - (int)($H / 28)*(int)(29 / > ($H + > 1))*((int)(21 - $G) / 11)); > $J = ($Year + (int)($Year/4) + $I + 2 - $C + (int)($C/4)) % 7; > $L = $I - $J; > $m = 3 + (int)(($L + 40) / 44); > $d = $L + 28 - 31 * ((int)($m / 4)); > $y = $Year; > $E = mktime(0,0,0, $m, $d, $y); > > return $E; > } > } Thanks Shawn! Actually, I've given up on the PHP function, and managed to extract the info I need from 'pFeast' class. This class uses the same code as above but with some major enhancements. A little bit more work on the code, and it'll be accomplishing what I need. Thanks for your suggestion! Regards, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error on functions valid for PHP 4, 5
kro...@aolohr.com wrote: > Thanks Chris. > > Seems like the function is a dud. I have '-enable-calendar' working on both > local and production. Sigh . . > > I have been using another modified 'easter' function, 'pFeast', (can't for > the > life of me find it on the net now). It works well, but I need to set the > output to a variable, so I can use it for other purposes. But that's another > prob . . . > > Regards, > Andree > > > > On October 9, 2009 02:46:52 pm Chris Streatfield wrote: >> Out put on PHP 5.2.4 >> >> >> Parse error: syntax error, unexpected T_STRING in /testphp.php on line 2 >> >> >> Line 2 is the first line of code. >> >> Output on PHP 5.2.6 and on PHP 5.3.0 local >> >> blank page. >> >> All the best >> Chris Streatfield >> Tel: +64 4 475 7846 >> Mob: 021 102 6018 >> Skype: chrisstreat >> >> On Sat, 10 Oct 2009 02:01:24 kro...@aolohr.com wrote: >>> Hi, >>> >>> Would someone be kind enough to test whether these following functions >>> work? >>> >>> I'm getting: "PHP Fatal error: Call to undefined function >> easter_date() . . . >> >>> easter_days" on both local and production sites. >>> >>> >>> >> >>> echo easter_days(2009); >>> print ""; >>> echo date("M-d-Y", easter_date(2009)); >>> print ""; >>> echo date("D d M Y", easter_date(2009)); >>> >>> ?> >>> >>> >>> I'm using 5.2.10 production; PHP 5.2.4 local. >>> >>> Tia, >>> Andre >>> >>> -- >>> PHP General Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php > > Well, I'm not sure why you don't have the function, but if you scroll to the bottom of http://us2.php.net/manual/en/function.easter-date.php: if(!function_exists('easter_date')) { function easter_date ($Year) { /* G is the Golden Number-1 H is 23-Epact (modulo 30) I is the number of days from 21 March to the Paschal full moon J is the weekday for the Paschal full moon (0=Sunday, 1=Monday, etc.) L is the number of days from 21 March to the Sunday on or before the Paschal full moon (a number between -6 and 28) */ $G = $Year % 19; $C = (int)($Year / 100); $H = (int)($C - (int)($C / 4) - (int)((8*$C+13) / 25) + 19*$G + 15) % 30; $I = (int)$H - (int)($H / 28)*(1 - (int)($H / 28)*(int)(29 / ($H + 1))*((int)(21 - $G) / 11)); $J = ($Year + (int)($Year/4) + $I + 2 - $C + (int)($C/4)) % 7; $L = $I - $J; $m = 3 + (int)(($L + 40) / 44); $d = $L + 28 - 31 * ((int)($m / 4)); $y = $Year; $E = mktime(0,0,0, $m, $d, $y); return $E; } } -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error on functions valid for PHP 4, 5
Thanks Chris. Seems like the function is a dud. I have '-enable-calendar' working on both local and production. Sigh . . I have been using another modified 'easter' function, 'pFeast', (can't for the life of me find it on the net now). It works well, but I need to set the output to a variable, so I can use it for other purposes. But that's another prob . . . Regards, Andree On October 9, 2009 02:46:52 pm Chris Streatfield wrote: > Out put on PHP 5.2.4 > > > Parse error: syntax error, unexpected T_STRING in /testphp.php on line 2 > > > Line 2 is the first line of code. > > Output on PHP 5.2.6 and on PHP 5.3.0 local > > blank page. > > All the best > Chris Streatfield > Tel: +64 4 475 7846 > Mob: 021 102 6018 > Skype: chrisstreat > > On Sat, 10 Oct 2009 02:01:24 kro...@aolohr.com wrote: > > Hi, > > > > Would someone be kind enough to test whether these following functions > > work? > > > > I'm getting: "PHP Fatal error: Call to undefined function > > easter_date() . . . > > > easter_days" on both local and production sites. > > > > > > > > > echo easter_days(2009); > > print ""; > > echo date("M-d-Y", easter_date(2009)); > > print ""; > > echo date("D d M Y", easter_date(2009)); > > > > ?> > > > > > > I'm using 5.2.10 production; PHP 5.2.4 local. > > > > Tia, > > Andre > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error on functions valid for PHP 4, 5
Out put on PHP 5.2.4 Parse error: syntax error, unexpected T_STRING in /testphp.php on line 2 Line 2 is the first line of code. Output on PHP 5.2.6 and on PHP 5.3.0 local blank page. All the best Chris Streatfield Tel: +64 4 475 7846 Mob: 021 102 6018 Skype: chrisstreat On Sat, 10 Oct 2009 02:01:24 kro...@aolohr.com wrote: > Hi, > > Would someone be kind enough to test whether these following functions work? > > I'm getting: "PHP Fatal error: Call to undefined function easter_date() . . . > easter_days" on both local and production sites. > > > > echo easter_days(2009); > print ""; > echo date("M-d-Y", easter_date(2009)); > print ""; > echo date("D d M Y", easter_date(2009)); > > ?> > > > I'm using 5.2.10 production; PHP 5.2.4 local. > > Tia, > Andre > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error on functions valid for PHP 4, 5
Hi Jonathon, I'm using Mandriva 2008.0 x86_64 version (which probably didn't have that enabled).. Thanks -- will check. Be fun trying to enable it though, given Mandriva's propensity to stick stuff in weird places. Sigh . . . Andre On October 9, 2009 09:20:29 am Jonathan Tapicer wrote: > What platform? If you compiled PHP yourself you need to compile with > --enable-calendar. > > Jonathan > > On Fri, Oct 9, 2009 at 10:01 AM, wrote: > > Hi, > > > > Would someone be kind enough to test whether these following functions > > work? > > > > I'm getting: "PHP Fatal error: Call to undefined function easter_date() > > . . . easter_days" on both local and production sites. > > > > > > > > > echo easter_days(2009); > > print ""; > > echo date("M-d-Y", easter_date(2009)); > > print ""; > > echo date("D d M Y", easter_date(2009)); > > > > ?> > > > > > > I'm using 5.2.10 production; PHP 5.2.4 local. > > > > Tia, > > Andre > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error on functions valid for PHP 4, 5
What platform? If you compiled PHP yourself you need to compile with --enable-calendar. Jonathan On Fri, Oct 9, 2009 at 10:01 AM, wrote: > Hi, > > Would someone be kind enough to test whether these following functions work? > > I'm getting: "PHP Fatal error: Call to undefined function easter_date() . . . > easter_days" on both local and production sites. > > > > echo easter_days(2009); > print ""; > echo date("M-d-Y", easter_date(2009)); > print ""; > echo date("D d M Y", easter_date(2009)); > > ?> > > > I'm using 5.2.10 production; PHP 5.2.4 local. > > Tia, > Andre > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fatal error on functions valid for PHP 4, 5
Hi, Would someone be kind enough to test whether these following functions work? I'm getting: "PHP Fatal error: Call to undefined function easter_date() . . . easter_days" on both local and production sites. "; echo date("M-d-Y", easter_date(2009)); print ""; echo date("D d M Y", easter_date(2009)); ?> I'm using 5.2.10 production; PHP 5.2.4 local. Tia, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function:mysqli_connect()in
Shawn McKenzie wrote: > revDAVE wrote: >> On 3/14/2009 10:36 AM, "Gary" wrote: >> >>> Can anyone enlighted me as to what I am not doing correctly? >> >> Hi Gary, >> >> I am hosted using a basic cpanel interface ... There's a button = Remote >> MySQL which brings up a page: Remote Database Access Hosts >> >> And I put in my HOME IP and all works fine now ... >> >> Not sure how godaddy does it... Maybe ask tech support How to set up >> Remote MySQL access >> >> -- >> Thanks - RevDave >> Cool @ hosting4days . com >> [db-lists 09] >> >> >> > > That web interface isn't using the mysqli functions, it probably > phpMyAdmin using the mysql functions. If you would read my previous > post you'd see that mysqli isn't supported under PHP4. > > I guess I need to reply all instead of replying to the newsgroup as > people seem to not read anything I post to the newsgroup. > FYI from previous post... Yes, the mysqli extension is only available for PHP5. Use the mysql_x() functions or move to a host that supports PHP5/mysqli extension. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function:mysqli_connect() in
revDAVE wrote: > On 3/14/2009 10:36 AM, "Gary" wrote: > >> Can anyone enlighted me as to what I am not doing correctly? > > > Hi Gary, > > I am hosted using a basic cpanel interface ... There's a button = Remote > MySQL which brings up a page: Remote Database Access Hosts > > And I put in my HOME IP and all works fine now ... > > Not sure how godaddy does it... Maybe ask tech support How to set up > Remote MySQL access > > -- > Thanks - RevDave > Cool @ hosting4days . com > [db-lists 09] > > > That web interface isn't using the mysqli functions, it probably phpMyAdmin using the mysql functions. If you would read my previous post you'd see that mysqli isn't supported under PHP4. I guess I need to reply all instead of replying to the newsgroup as people seem to not read anything I post to the newsgroup. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
On 3/14/2009 10:36 AM, "Gary" wrote: > Can anyone enlighted me as to what I am not doing correctly? Hi Gary, I am hosted using a basic cpanel interface ... There's a button = Remote MySQL which brings up a page: Remote Database Access Hosts And I put in my HOME IP and all works fine now ... Not sure how godaddy does it... Maybe ask tech support How to set up Remote MySQL access -- Thanks - RevDave Cool @ hosting4days . com [db-lists 09] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Gary wrote: > Thanks again to everyone. > > I have just checked the servers phpinfo, and turns out they are running PHP > Version 4.3.11 while I have verstion 5.2.8, could this change any of the > advice? Yes, the mysqli extension is only available for PHP5. Use the mysql_x() functions or move to a host that supports PHP5/mysqli extension. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Thanks again to everyone. I have just checked the servers phpinfo, and turns out they are running PHP Version 4.3.11 while I have verstion 5.2.8, could this change any of the advice? ""Jan G.B."" wrote in message news:c9a09d00903141132i19597e73g2271955d1ac14...@mail.gmail.com... Gary, you can check this by either creating a file containing this: and putting it up on your webserver, then open in with your browser, or you could look at the output of "php -i | less" on the command line. After you enabled the mysqli extension on your host, you might change mysqli_connect('$var', '$var2', ...); to mysqli_connect($var, $var2, ...) One side node.. you should apply addslashes() also to $_SERVER['REMOTE_ADDR'), because an evil person could manipulate the value of that variable to execute SQL-Injections. Bye 2009/3/14 Gary : > Thanks for your quick reply, but I do not know what that means... Where > would I find this out and how would I accomplish this if it is not done? > > Thanks again. > > "Per Jessen" wrote in message > news:gpgq8i$h5...@saturn.local.net... > Gary wrote: > >> I am recieving a fatal error trying to connect to my server/mysql. >> This is my first attempt at connecting to a remote server, have been >> successful with localhost (apache). I had the variation of not putting >> the hostname & others into a variable, but that did not work either. >> >> I have also genericised the username and password for this post. Host >> name is correct. >> >> Can anyone enlighted me as to what I am not doing correctly? >> >> >> Fatal error: Call to undefined function: mysqli_connect() in > > Check if the mysqli extension has been loaded. > > > /Per > > > -- > Per Jessen, Zürich (10.9°C) > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Ok.. I have added [MySQL] ;Gary, this is the code from the forum. extension=mysqli.so to the php.ini file on my machine, I saved the file. Is there anything else I need to do? Thanks again. "Per Jessen" wrote in message news:gpgu1t$ho...@saturn.local.net... Gary wrote: > I had the code written the way you suggested, but changed it to the > way the hosting company suggested. I think your hosting company might be smoking something they shouldn't be. Your way is the right one. > I am unclear. I have php 5.2.8.8 on my local machine, I also have > MySQL 5.1.30 set up locally as well. Okay. > I am using godaddy.com as a host. I assumed that the php was running > on the host server and the local php that I have/use is only for the > testing server. > > Does this sound correct to you? Let me paraphrase - you've been developing an application in your local environment, and you're now moving it to your hosting environment. It sounds very much like the mysqli extension isn't loaded (by default) in your hosting environment. Find out by calling phpinfo() - if there is no information from mysqli, the extension wasn't loaded. Or try using extension_loaded('mysqli') and see what that says. To load the extension, you could use dl() in your code although it might have been disabled. Otherwise you need to modify the correct php.ini and add the extension=mysqli.so line. /Per -- Per Jessen, Zürich (10.4°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Ok.. I have added [MySQL] ;Gary, this is the code from the forum. extension=mysqli.so to the php.ini file on my machine, I saved the file. Is there anything else I need to do? Thanks again. "Per Jessen" wrote in message news:gpgu1t$ho...@saturn.local.net... Gary wrote: > I had the code written the way you suggested, but changed it to the > way the hosting company suggested. I think your hosting company might be smoking something they shouldn't be. Your way is the right one. > I am unclear. I have php 5.2.8.8 on my local machine, I also have > MySQL 5.1.30 set up locally as well. Okay. > I am using godaddy.com as a host. I assumed that the php was running > on the host server and the local php that I have/use is only for the > testing server. > > Does this sound correct to you? Let me paraphrase - you've been developing an application in your local environment, and you're now moving it to your hosting environment. It sounds very much like the mysqli extension isn't loaded (by default) in your hosting environment. Find out by calling phpinfo() - if there is no information from mysqli, the extension wasn't loaded. Or try using extension_loaded('mysqli') and see what that says. To load the extension, you could use dl() in your code although it might have been disabled. Otherwise you need to modify the correct php.ini and add the extension=mysqli.so line. /Per -- Per Jessen, Zürich (10.4°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Gary wrote: > I had the code written the way you suggested, but changed it to the > way the hosting company suggested. I think your hosting company might be smoking something they shouldn't be. Your way is the right one. > I am unclear. I have php 5.2.8.8 on my local machine, I also have > MySQL 5.1.30 set up locally as well. Okay. > I am using godaddy.com as a host. I assumed that the php was running > on the host server and the local php that I have/use is only for the > testing server. > > Does this sound correct to you? Let me paraphrase - you've been developing an application in your local environment, and you're now moving it to your hosting environment. It sounds very much like the mysqli extension isn't loaded (by default) in your hosting environment. Find out by calling phpinfo() - if there is no information from mysqli, the extension wasn't loaded. Or try using extension_loaded('mysqli') and see what that says. To load the extension, you could use dl() in your code although it might have been disabled. Otherwise you need to modify the correct php.ini and add the extension=mysqli.so line. /Per -- Per Jessen, Zürich (10.4°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
2009/3/14 Jan G.B. : > One side node.. you should apply addslashes() also to > $_SERVER['REMOTE_ADDR'), because an evil person could manipulate the > value of that variable to execute SQL-Injections. forget that part - i didn't see that this var is only used in the email, not in the query. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Gary, you can check this by either creating a file containing this: and putting it up on your webserver, then open in with your browser, or you could look at the output of "php -i | less" on the command line. After you enabled the mysqli extension on your host, you might change mysqli_connect('$var', '$var2', ...); to mysqli_connect($var, $var2, ...) One side node.. you should apply addslashes() also to $_SERVER['REMOTE_ADDR'), because an evil person could manipulate the value of that variable to execute SQL-Injections. Bye 2009/3/14 Gary : > Thanks for your quick reply, but I do not know what that means... Where > would I find this out and how would I accomplish this if it is not done? > > Thanks again. > > "Per Jessen" wrote in message > news:gpgq8i$h5...@saturn.local.net... > Gary wrote: > >> I am recieving a fatal error trying to connect to my server/mysql. >> This is my first attempt at connecting to a remote server, have been >> successful with localhost (apache). I had the variation of not putting >> the hostname & others into a variable, but that did not work either. >> >> I have also genericised the username and password for this post. Host >> name is correct. >> >> Can anyone enlighted me as to what I am not doing correctly? >> >> >> Fatal error: Call to undefined function: mysqli_connect() in > > Check if the mysqli extension has been loaded. > > > /Per > > > -- > Per Jessen, Zürich (10.9°C) > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
I had the code written the way you suggested, but changed it to the way the hosting company suggested. I am unclear. I have php 5.2.8.8 on my local machine, I also have MySQL 5.1.30 set up locally as well. I am using godaddy.com as a host. I assumed that the php was running on the host server and the local php that I have/use is only for the testing server. Does this sound correct to you? Again, many thanks. "Per Jessen" wrote in message news:gpgruj$hc...@saturn.local.net... Gary wrote: > Ok, I know how to access the php.ini for the local host, is this the > same file that would control the remote server? Or do I need to look > for it on my remote host? The php.ini you need to look at is the one one the server where you're running your PHP code. The remote host is just your database server I assume? Your code does look a little odd though: $dbc = mysqli_connect('$hostname','$username','$password') or die('Error connecting to MySQL server'); mysql_select_db('$usertable'); I would have written this as: $dbc = mysqli_connect($hostname,$username,$password,$usertable) or die('Error connecting to MySQL server'); /Per -- Per Jessen, Zürich (10.7°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Gary wrote: > Ok, I know how to access the php.ini for the local host, is this the > same file that would control the remote server? Or do I need to look > for it on my remote host? The php.ini you need to look at is the one one the server where you're running your PHP code. The remote host is just your database server I assume? Your code does look a little odd though: $dbc = mysqli_connect('$hostname','$username','$password') or die('Error connecting to MySQL server'); mysql_select_db('$usertable'); I would have written this as: $dbc = mysqli_connect($hostname,$username,$password,$usertable) or die('Error connecting to MySQL server'); /Per -- Per Jessen, Zürich (10.7°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Ok, I know how to access the php.ini for the local host, is this the same file that would control the remote server? Or do I need to look for it on my remote host? Again, thanks for your help. "Per Jessen" wrote in message news:gpgr6o$hc...@saturn.local.net... Gary wrote: > Thanks for your quick reply, but I do not know what that means... > Where would I find this out and how would I accomplish this if it is > not done? > > Thanks again. Hi Gary see what phpinfo() says - if the extension is loaded, it'll show up there. To load the extension, add "extension=mysqli.so" to your php.ini (if it's not already there). /Per -- Per Jessen, Zürich (10.9°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Gary wrote: > Thanks for your quick reply, but I do not know what that means... > Where would I find this out and how would I accomplish this if it is > not done? > > Thanks again. Hi Gary see what phpinfo() says - if the extension is loaded, it'll show up there. To load the extension, add "extension=mysqli.so" to your php.ini (if it's not already there). /Per -- Per Jessen, Zürich (10.9°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Thanks for your quick reply, but I do not know what that means... Where would I find this out and how would I accomplish this if it is not done? Thanks again. "Per Jessen" wrote in message news:gpgq8i$h5...@saturn.local.net... Gary wrote: > I am recieving a fatal error trying to connect to my server/mysql. > This is my first attempt at connecting to a remote server, have been > successful with localhost (apache). I had the variation of not putting > the hostname & others into a variable, but that did not work either. > > I have also genericised the username and password for this post. Host > name is correct. > > Can anyone enlighted me as to what I am not doing correctly? > > > Fatal error: Call to undefined function: mysqli_connect() in Check if the mysqli extension has been loaded. /Per -- Per Jessen, Zürich (10.9°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
On Sat, Mar 14, 2009 at 13:41, Per Jessen wrote: > > Check if the mysqli extension has been loaded. Also check this page: http://us.php.net/manual/en/mysqli.connect.php For some of the mirrors, trying to hit http://php.net/mysqli_connect erroneously takes you to the mysql_connect() function documentation. It's a bug of which we *are* aware and are working to repair. -- daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Gary wrote: > I am recieving a fatal error trying to connect to my server/mysql. > This is my first attempt at connecting to a remote server, have been > successful with localhost (apache). I had the variation of not putting > the hostname & others into a variable, but that did not work either. > > I have also genericised the username and password for this post. Host > name is correct. > > Can anyone enlighted me as to what I am not doing correctly? > > > Fatal error: Call to undefined function: mysqli_connect() in Check if the mysqli extension has been loaded. /Per -- Per Jessen, Zürich (10.9°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fatal error: Call to undefined function: mysqli_connect() in
I am recieving a fatal error trying to connect to my server/mysql. This is my first attempt at connecting to a remote server, have been successful with localhost (apache). I had the variation of not putting the hostname & others into a variable, but that did not work either. I have also genericised the username and password for this post. Host name is correct. Can anyone enlighted me as to what I am not doing correctly? Fatal error: Call to undefined function: mysqli_connect() in Please enter a valid phone"); } if (strlen($phone) >15) { die("Please enter a valid phone"); } if (! ereg('[a-za-z0-9_-...@[a-za-z0-9_-]+\.[a-za-z0-9_-]+', $email)) { die("Please enter a valid email"); } // checks if bot if ($_POST['address'] != '' ){ die("Changed field"); } //Connect To Database $hostname='h50mysql43.secureserver.net'; $username='myusername'; $password='mypassword'; $dbname='mydbname'; $usertable='tablename'; $dbc = mysqli_connect('$hostname','$username','$password') or die('Error connecting to MySQL server'); mysql_select_db('$usertable'); $query = "INSERT INTO contact(first_name, last_name, company, phone, email, url, comments) ". "VALUES ('$first_name','$last_name','$company','$phone','$email','$url','$comments') "; $result = mysqli_query($dbc, $query) or die('Error querying database.'); mysqli_close($dbc); //Sending Email to form owner $pfw_header = "From: $email\n" . "Reply-To: $email\n"; $pfw_subject = "Subject Message"; $pfw_email_to = "em...@email.com"; $pfw_message = "Visitor's IP: $pfw_ip\n" . "name: $first_name . ' '.$last_name\n" . "company: $company\n" . "phone: $phone\n" . "email: $email\n" . "url: $url\n" . "comments: $comments\n" @mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ; echo("Thank you for your submission, we will respond shortly!"); echo "Thank you $first_name for your request"; echo "We have the following information from you.";?> "; echo "Last Name: $last_name"; echo "Company Name: $company"; echo "Phone Number: $phone"; echo "Web Address: $url"; echo "Email Address: $email.";?> "; ?> ';?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Cannot redeclare
What is around this line? /global/WEB_DAT/documents/fme/institute/get/lehre/course/lib.php:25 Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Kai Kauer wrote: > Am Dienstag, 5. August 2008 15:46:42 schrieb Daniel Brown: > >> On Tue, Aug 5, 2008 at 9:37 AM, Kai Kauer <[EMAIL PROTECTED]> wrote: >> >>> Hi @all, >>> >>> I was just installing the Moodle-Version 1.9.2 at our university. It was >>> installed without any problems. But during testing and preparing for use >>> I got this error message: >>> >>> Fatal error: Cannot redeclare make_log_url() (previously declared >>> in /global/WEB_DAT/documents/fme/institute/get/lehre/course/lib.php:25) >>> in ./lib.php on line 54 >>> >> This is usually a result of the same function include script being >> included twice, and thus, the function being defined a second time. >> Check ./lib.php on line 54 and see if it's including itself, or if - >> for whatever reason - there's two entries in that file starting with >> "function make_log_url(***)". >> >> >> >> *** Optional parameters may be enclosed within the parentheses. >> >> > > This function make the error message > > >> function make_log_url($module, $url) { >> switch ($module) { >> case 'course': >> case 'file': >> case 'login': >> case 'lib': >> case 'admin': >> case 'calendar': >> case 'mnet course': >> return "/course/$url"; >> break; >> case 'user': >> case 'blog': >> return "/$module/$url"; >> break; >> case 'upload': >> return $url; >> break; >> case 'library': >> case '': >> return '/'; >> break; >> case 'message': >> return "/message/$url"; >> break; >> default: >> return "/mod/$module/$url"; >> break; >> } >> } >> > > and is in the whole project just called one time in this function: > > >> function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, >> $perpage=100, $url="", $modname="", $modid=0, $modaction="", $groupid=0) { >> >> global $CFG; >> >> if (!$logs = build_logs_array($course, $user, $date, $order, >> $page*$perpage, $perpage, $modname, $modid, $modaction, $groupid)) { >> notify("No logs found!"); >> print_footer($course); >> exit; >> } >> >> $courses = array(); >> >> if ($course->id == SITEID) { >> $courses[0] = ''; >> if ($ccc = get_courses('all', 'c.id ASC', 'c.id,c.shortname')) { >> foreach ($ccc as $cc) { >> $courses[$cc->id] = $cc->shortname; >> } >> } >> } else { >> $courses[$course->id] = $course->shortname; >> } >> >> $totalcount = $logs['totalcount']; >> $count=0; >> $ldcache = array(); >> $tt = getdate(time()); >> $today = mktime (0, 0, 0, $tt["mon"], $tt["mday"], $tt["year"]); >> >> $strftimedatetime = get_string("strftimedatetime"); >> >> echo "\n"; >> print_string("displayingrecords", "", $totalcount); >> echo "\n"; >> >> print_paging_bar($totalcount, $page, $perpage, >> "$url&perpage=$perpage&"); >> >> echo '> summary="">'."\n"; // echo "> cellspacing=\"0\" summary=\"\">\n"; echo ""; >> if ($course->id == SITEID) { >> echo "> scope=\"col\">".get_string('course')."\n"; } >> echo "> scope=\"col\">".get_string('time')."\n"; echo "> scope=\"col\">".get_string('ip_address')."\n"; echo "> header\" scope=\"col\">".get_string('fullname')."\n"; echo "> class=\"c4 header\" scope=\"col\">".get_string('action')."\n"; echo >> "".get_string('info')."\n"; echo >> "\n"; >> >> // Make sure that the logs array is an array, even it is empty, to >> avoid warnings from the foreach. if (empty($logs['logs'])) { >> $logs['logs'] = array(); >> } >> >> $row = 1; >> foreach ($logs['logs'] as $log) { >> >> $row = ($row + 1) % 2; >> >> if (isset($ldcache[$log->module][$log->action])) { >> $ld = $ldcache[$log->module][$log->action]; >> } else { >> $ld = get_record('log_display', 'module', $log->module, >> 'action', $log->action); $ldcache[$log->module][$log->action] = $ld; >> } >> if ($ld && is_numeric($log->info)) { >> // ugly hack to make sure fullname is shown correctly >> if (($ld->mtable == 'user') and ($ld->field == >> sql_concat('firstname', "' '" , 'lastname'))) { $log->info = >> fullname(get_record($ld->mtable, 'id', $log->info), true); } else { >> $log->info = get_field($ld->mtable, $ld->field, 'id', >> $log->info); } >> } >> >> //Filter log->info >> $log->info = format_string($log->info); >> >> // If $log->url has been trimmed short by the db size restriction >> // code in add_to_log, keep a note so
Re: [PHP] Fatal error: Cannot redeclare
Am Dienstag, 5. August 2008 15:46:42 schrieb Daniel Brown: > On Tue, Aug 5, 2008 at 9:37 AM, Kai Kauer <[EMAIL PROTECTED]> wrote: > > Hi @all, > > > > I was just installing the Moodle-Version 1.9.2 at our university. It was > > installed without any problems. But during testing and preparing for use > > I got this error message: > > > > Fatal error: Cannot redeclare make_log_url() (previously declared > > in /global/WEB_DAT/documents/fme/institute/get/lehre/course/lib.php:25) > > in ./lib.php on line 54 > > This is usually a result of the same function include script being > included twice, and thus, the function being defined a second time. > Check ./lib.php on line 54 and see if it's including itself, or if - > for whatever reason - there's two entries in that file starting with > "function make_log_url(***)". > > > > *** Optional parameters may be enclosed within the parentheses. > This function make the error message > function make_log_url($module, $url) { > switch ($module) { > case 'course': > case 'file': > case 'login': > case 'lib': > case 'admin': > case 'calendar': > case 'mnet course': > return "/course/$url"; > break; > case 'user': > case 'blog': > return "/$module/$url"; > break; > case 'upload': > return $url; > break; > case 'library': > case '': > return '/'; > break; > case 'message': > return "/message/$url"; > break; > default: > return "/mod/$module/$url"; > break; > } > } and is in the whole project just called one time in this function: > function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, > $perpage=100, $url="", $modname="", $modid=0, $modaction="", $groupid=0) { > > global $CFG; > > if (!$logs = build_logs_array($course, $user, $date, $order, > $page*$perpage, $perpage, $modname, $modid, $modaction, $groupid)) { > notify("No logs found!"); > print_footer($course); > exit; > } > > $courses = array(); > > if ($course->id == SITEID) { > $courses[0] = ''; > if ($ccc = get_courses('all', 'c.id ASC', 'c.id,c.shortname')) { > foreach ($ccc as $cc) { > $courses[$cc->id] = $cc->shortname; > } > } > } else { > $courses[$course->id] = $course->shortname; > } > > $totalcount = $logs['totalcount']; > $count=0; > $ldcache = array(); > $tt = getdate(time()); > $today = mktime (0, 0, 0, $tt["mon"], $tt["mday"], $tt["year"]); > > $strftimedatetime = get_string("strftimedatetime"); > > echo "\n"; > print_string("displayingrecords", "", $totalcount); > echo "\n"; > > print_paging_bar($totalcount, $page, $perpage, > "$url&perpage=$perpage&"); > > echo ' summary="">'."\n"; // echo " cellspacing=\"0\" summary=\"\">\n"; echo ""; > if ($course->id == SITEID) { > echo " scope=\"col\">".get_string('course')."\n"; } > echo " scope=\"col\">".get_string('time')."\n"; echo " scope=\"col\">".get_string('ip_address')."\n"; echo " header\" scope=\"col\">".get_string('fullname')."\n"; echo " class=\"c4 header\" scope=\"col\">".get_string('action')."\n"; echo > "".get_string('info')."\n"; echo > "\n"; > > // Make sure that the logs array is an array, even it is empty, to > avoid warnings from the foreach. if (empty($logs['logs'])) { > $logs['logs'] = array(); > } > > $row = 1; > foreach ($logs['logs'] as $log) { > > $row = ($row + 1) % 2; > > if (isset($ldcache[$log->module][$log->action])) { > $ld = $ldcache[$log->module][$log->action]; > } else { > $ld = get_record('log_display', 'module', $log->module, > 'action', $log->action); $ldcache[$log->module][$log->action] = $ld; > } > if ($ld && is_numeric($log->info)) { > // ugly hack to make sure fullname is shown correctly > if (($ld->mtable == 'user') and ($ld->field == > sql_concat('firstname', "' '" , 'lastname'))) { $log->info = > fullname(get_record($ld->mtable, 'id', $log->info), true); } else { > $log->info = get_field($ld->mtable, $ld->field, 'id', > $log->info); } > } > > //Filter log->info > $log->info = format_string($log->info); > > // If $log->url has been trimmed short by the db size restriction > // code in add_to_log, keep a note so we don't add a link to a > broken url $tl=textlib_get_instance(); > $brokenurl=($tl->strlen($log->url)==100 && > $tl->substr($log->url,97)=='...'); > > $log->url = strip_tags(urldecode($log->url)); // Some XSS > protection $log->info = strip_tags(urldecode($log->info)); // Some XSS > protection $log->url = s($log->url); /// XSS protection and XHTML > compatibi
Re: [PHP] Fatal error: Cannot redeclare
On Tue, Aug 5, 2008 at 9:37 AM, Kai Kauer <[EMAIL PROTECTED]> wrote: > Hi @all, > > I was just installing the Moodle-Version 1.9.2 at our university. It was > installed without any problems. But during testing and preparing for use I > got this error message: > > Fatal error: Cannot redeclare make_log_url() (previously declared > in /global/WEB_DAT/documents/fme/institute/get/lehre/course/lib.php:25) > in ./lib.php on line 54 This is usually a result of the same function include script being included twice, and thus, the function being defined a second time. Check ./lib.php on line 54 and see if it's including itself, or if - for whatever reason - there's two entries in that file starting with "function make_log_url(***)". *** Optional parameters may be enclosed within the parentheses. -- Better prices on dedicated servers: Intel 2.4GHz/60GB/512MB/2TB $49.99/mo. Intel 3.06GHz/80GB/1GB/2TB $59.99/mo. Intel 2.4GHz/320/GB/1GB/3TB $74.99/mo. Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fatal error: Cannot redeclare
Hi @all, I was just installing the Moodle-Version 1.9.2 at our university. It was installed without any problems. But during testing and preparing for use I got this error message: Fatal error: Cannot redeclare make_log_url() (previously declared in /global/WEB_DAT/documents/fme/institute/get/lehre/course/lib.php:25) in ./lib.php on line 54 This error is only shown in the course administration (e. g. adding or editing courses). Other function do not have any problems. I tried to find single "include" or "require", but didn't find any (there are always "inlcude_once" or "require_once" commands used). If I try to deactivate the function this error is shown again with the next function. Does anyone know a solution? Or does anyone know where I can ask for a solution? I posted this also at the moodle-forum. Thanks for help greets Kai P.S.: Sorry for my bad english. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to a member function web_order_change() on a non-object
register_globals got turned off. All your $_SESSION variables (in your case, $_SESSION['SESSION']) need to be reference explicitly now. Add this at the top: $SESSION = $_SESSION['SESSION']; right after session_start(); On Mon, March 3, 2008 5:48 pm, Chris wrote: > Ben Edwards wrote: >> Our server has just been upgraded to PHP 5.2.5 and suddenly I am >> getting the following error: >> >> Fatal error: Call to a member function web_order_change() on a >> non-object in /var/www/vhosts/cultureshop.org/httpdocs/cart.php on >> line 32 >> >> The code is: >> >> $SESSION["cart"]->web_order_change( true ); >> >> The command 'global $SESSION;' is the first line of the script. >> >> $SESSION is the session variable created with >> >> session_start(); >> session_register("SESSION"); >> >> if ( !isset($SESSION["cart"]) ) { >> $SESSION["cart"] = new Cart; >> } >> >> I am guessing this is a change in OO handling, any idea what is >> going >> on and how to fix it? > > I don't think it's a change in OO handling, maybe it's a change in the > error_reporting level for the new version and you hadn't noticed the > problem before. > > The problem is that $SESSION['cart'] isn't an object - you'll have to > work out why. > > It could be that $SESSION['cart'] is getting overridden at some point > with another type of variable. > > -- > Postgresql & php tutorials > http://www.designmagick.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to a member function web_order_change() on a non-object
On Tue, Mar 4, 2008 at 5:09 AM, Jochem Maas <[EMAIL PROTECTED]> wrote: > Ben Edwards schreef: > > > Our server has just been upgraded to PHP 5.2.5 and suddenly I am > > getting the following error: > > > > Fatal error: Call to a member function web_order_change() on a > > non-object in /var/www/vhosts/cultureshop.org/httpdocs/cart.php on > > line 32 > > > > The code is: > > > > $SESSION["cart"]->web_order_change( true ); > > > > The command 'global $SESSION;' is the first line of the script. > > > > > $SESSION is the session variable created with > > > > session_start(); > > session_register("SESSION"); > > don't use session_register(), use the $_SESSION superglobal instead > (notice the underscore) ... you can read in the manual about this. > > additionally you need to load in the class before you start the > session. > > so the code would look something like: > > require 'Cart.class.php'; > session_start(); > > > if (!isset($_SESSION['cart'])) > $_SESSION['cart'] = new Cart; > > function foo() > { > // no need to use global on $_SESSION > $_SESSION["cart"]->web_order_change( true ); > > } > > > > > if ( !isset($SESSION["cart"]) ) { > > $SESSION["cart"] = new Cart; > > } > > > > I am guessing this is a change in OO handling, any idea what is going > > on and how to fix it? > > the crux of the problem lies in the use of outdated session semantics, I'm > guess you've just been upgrade from 4.x, is that correct? > > > > > Regards, > > Ben > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > He might not have loaded the class definition also. That'd lead to the nasty __PHP_Incomplete_Class. Or maybe it is something to do with class names in php4 weren't case sensitive whereas in php5 they are. I've used the unserialize_callback_func feature before to auto load classes. Oh I just read that Jim said this earlier, but I'm going to post it anyways after typing it up. ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to a member function web_order_change() on a non-object
Ben Edwards schreef: Our server has just been upgraded to PHP 5.2.5 and suddenly I am getting the following error: Fatal error: Call to a member function web_order_change() on a non-object in /var/www/vhosts/cultureshop.org/httpdocs/cart.php on line 32 The code is: $SESSION["cart"]->web_order_change( true ); The command 'global $SESSION;' is the first line of the script. $SESSION is the session variable created with session_start(); session_register("SESSION"); don't use session_register(), use the $_SESSION superglobal instead (notice the underscore) ... you can read in the manual about this. additionally you need to load in the class before you start the session. so the code would look something like: require 'Cart.class.php'; session_start(); if (!isset($_SESSION['cart'])) $_SESSION['cart'] = new Cart; function foo() { // no need to use global on $_SESSION $_SESSION["cart"]->web_order_change( true ); } if ( !isset($SESSION["cart"]) ) { $SESSION["cart"] = new Cart; } I am guessing this is a change in OO handling, any idea what is going on and how to fix it? the crux of the problem lies in the use of outdated session semantics, I'm guess you've just been upgrade from 4.x, is that correct? Regards, Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to a member function web_order_change() on a non-object
Chris wrote: I don't think it's a change in OO handling, maybe it's a change in the error_reporting level for the new version and you hadn't noticed the problem before. Its a Fatel Error not a warning. Dont see how level off error reporting could be relevant. Fair enough :P What type of variable is 'cart' when this error happens? Have permissions been screwed on the session_save_path folder? (check a phpinfo for where this is if you're not setting it explicitly). Make sure that you are defining the class before you initialize the session. I have seen this happen with others on the list, and it has sometimes been that they are initializing the session, which tries to recreate the object, but the actual class definition has not happened yet. make sure you include all your classes before you initialize your session, see if that works. -- Jim Lucas "Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them." Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to a member function web_order_change() on a non-object
I don't think it's a change in OO handling, maybe it's a change in the error_reporting level for the new version and you hadn't noticed the problem before. Its a Fatel Error not a warning. Dont see how level off error reporting could be relevant. Fair enough :P What type of variable is 'cart' when this error happens? Have permissions been screwed on the session_save_path folder? (check a phpinfo for where this is if you're not setting it explicitly). -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to a member function web_order_change() on a non-object
On 03/03/2008, Chris <[EMAIL PROTECTED]> wrote: > Ben Edwards wrote: > > Our server has just been upgraded to PHP 5.2.5 and suddenly I am > > getting the following error: > > > > Fatal error: Call to a member function web_order_change() on a > > non-object in /var/www/vhosts/cultureshop.org/httpdocs/cart.php on > > line 32 > > > > The code is: > > > > $SESSION["cart"]->web_order_change( true ); > > > > The command 'global $SESSION;' is the first line of the script. > > > > $SESSION is the session variable created with > > > > session_start(); > > session_register("SESSION"); > > > > if ( !isset($SESSION["cart"]) ) { > > $SESSION["cart"] = new Cart; > > } > > > > I am guessing this is a change in OO handling, any idea what is going > > on and how to fix it? > > > I don't think it's a change in OO handling, maybe it's a change in the > error_reporting level for the new version and you hadn't noticed the > problem before. Its a Fatel Error not a warning. Dont see how level off error reporting could be relevant. Regards, Ben > The problem is that $SESSION['cart'] isn't an object - you'll have to > work out why. > > It could be that $SESSION['cart'] is getting overridden at some point > with another type of variable. > > > -- > Postgresql & php tutorials > http://www.designmagick.com/ > -- Ben Edwards - Bristol, UK http://www.flickr.com/photos/funkytwig - have a look at my pics If you have a problem emailing me use http://www.gurtlush.org.uk/profiles.php?uid=4 (email address this email is sent from may be defunct) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to a member function web_order_change() on a non-object
Ben Edwards wrote: Our server has just been upgraded to PHP 5.2.5 and suddenly I am getting the following error: Fatal error: Call to a member function web_order_change() on a non-object in /var/www/vhosts/cultureshop.org/httpdocs/cart.php on line 32 The code is: $SESSION["cart"]->web_order_change( true ); The command 'global $SESSION;' is the first line of the script. $SESSION is the session variable created with session_start(); session_register("SESSION"); if ( !isset($SESSION["cart"]) ) { $SESSION["cart"] = new Cart; } I am guessing this is a change in OO handling, any idea what is going on and how to fix it? I don't think it's a change in OO handling, maybe it's a change in the error_reporting level for the new version and you hadn't noticed the problem before. The problem is that $SESSION['cart'] isn't an object - you'll have to work out why. It could be that $SESSION['cart'] is getting overridden at some point with another type of variable. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fatal error: Call to a member function web_order_change() on a non-object
Our server has just been upgraded to PHP 5.2.5 and suddenly I am getting the following error: Fatal error: Call to a member function web_order_change() on a non-object in /var/www/vhosts/cultureshop.org/httpdocs/cart.php on line 32 The code is: $SESSION["cart"]->web_order_change( true ); The command 'global $SESSION;' is the first line of the script. $SESSION is the session variable created with session_start(); session_register("SESSION"); if ( !isset($SESSION["cart"]) ) { $SESSION["cart"] = new Cart; } I am guessing this is a change in OO handling, any idea what is going on and how to fix it? Regards, Ben -- Ben Edwards - Bristol, UK http://www.flickr.com/photos/funkytwig - have a look at my pics If you have a problem emailing me use http://www.gurtlush.org.uk/profiles.php?uid=4 (email address this email is sent from may be defunct) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Function name must be a string
On Jan 2, 2008 4:58 PM, Adam Williams <[EMAIL PROTECTED]> wrote: > I'm getting the following error and I don't see whats wrong with my > line. Any ideas? > > *Fatal error*: Function name must be a string in > */var/www/sites/intra-test/contract/perform.php* on line *57* > > and my snippet of code is: > > if ( $_POST["perform"] == "View Contracts" ) > { > > $mysqli_get_userid = "SELECT user_id from user where email = > '".$_SESSION["username"]."'"; > > $mysqli_get_userid_result = $mysqli_query($mysqli, // line 57 > $mysqli_get_userid) or die(mysqli_error($mysqli)); > > while ($userid_result = > mysqli_fetch_array($mysqli_get_userid_result)) > { > $user_id = $userid_result["user_id"]; > } > } > Change: $mysqli_query($mysqli, to: mysqli_query($mysqli, Otherwise you're declaring mysqli_query() as a variable. -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fatal error: Function name must be a string
I'm getting the following error and I don't see whats wrong with my line. Any ideas? *Fatal error*: Function name must be a string in */var/www/sites/intra-test/contract/perform.php* on line *57* and my snippet of code is: if ( $_POST["perform"] == "View Contracts" ) { $mysqli_get_userid = "SELECT user_id from user where email = '".$_SESSION["username"]."'"; $mysqli_get_userid_result = $mysqli_query($mysqli, // line 57 $mysqli_get_userid) or die(mysqli_error($mysqli)); while ($userid_result = mysqli_fetch_array($mysqli_get_userid_result)) { $user_id = $userid_result["user_id"]; } }
Re: [PHP] Fatal error: Class 'DOMDocument' not found
Jeff Schwartz wrote: > I'm attempting to run the sample script on the PHP site: > >$dom = new DOMDocument('1.0', 'iso-8859-1'); > echo $dom->saveXML(); /* */ > ?> > > but get the error: > > Fatal error: Class 'DOMDocument' not found in /var/www/html/ajax/dom.php on > line 2 > > I'm running ver. 5.1.6 and my config appears to be set up for xml: > > './configure' '--build=i686-redhat-linux-gnu' > '--host=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' > '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' > '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' > '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' > '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' > '--infodir=/usr/share/info' '--cache-file=../config.cache' > '--with-libdir=lib' '--with-config-file-path=/etc' > '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' > '--disable-rpath' '--without-pear' '--with-bz2' '--with-curl' > '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' > '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' > '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' > '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' > '--with-zlib' '--with-layout=GNU' '--enable-exif' > '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' > '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' > '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos' > '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' > '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' > '--enable-dio' '--with-mime-magic=/etc/httpd/conf/magic' '--without-sqlite' > '--with-libxml-dir=/usr' '--with-xml' '--with-apxs2=/usr/sbin/apxs' > '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' > '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' > '--disable-xmlwriter' > > Has anyone else run into this? run into what? your configure line clearly states that the relevant extension is not compiled in (--disable-dom) you want http://php.net/dom not http://php.net/xml > > Thanks, > > Jeff > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fatal error: Class 'DOMDocument' not found
I'm attempting to run the sample script on the PHP site: saveXML(); /* */ ?> but get the error: Fatal error: Class 'DOMDocument' not found in /var/www/html/ajax/dom.php on line 2 I'm running ver. 5.1.6 and my config appears to be set up for xml: './configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--with-mime-magic=/etc/httpd/conf/magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable-xmlwriter' Has anyone else run into this? Thanks, Jeff
RE: [PHP] Fatal error when calling nested function
> > function salestax($price,$tax) { > function convert_pound($dollars, $conversion=1.6) { > return $dollars * $conversion; > } > $total = $price + ($price * $tax); > echo "Total cost in dollars: $total. Cost in British pounds: " > .convert_pound($total); > } > salestax(15.00,.075); > echo "" . convert_pound(15); > ?> > That's still pretty nasty though: salestax(15.00,.075); salestax(15.00,.075); ?> gives: Total cost in dollars: 16.125. Cost in British pounds: 25.8 24 Fatal error: Cannot redeclare convert_pound() ... What's wrong with non-nested functions? i.e.: function convert_pound($dollars, $conversion=1.6) { return $dollars * $conversion; } function salestax($price,$tax) { $total = $price + ($price * $tax); echo "Total cost in dollars: $total. Cost in British pounds: " .convert_pound($total); } E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error when calling nested function
Edward Kay wrote: Here's the list : I get the following error : *Fatal error*: Call to undefined function convert_pound() in ...*Untitled-1.php* on line *18 *line 18 is this one : echo convert_pound(15); From http://www.daaq.net/old/php/index.php?page=php+adv+functions&parent=php+flow +control: "When you define a function within another function it does not exist until the parent function is executed. Once the parent function has been executed, the nested function is defined and as with any function, accessible from anywhere within the current document. If you have nested functions in your code, you can only execute the outer function once. Repeated calls will try to redeclare the inner functions, which will generate an error." So, as you're not calling salestax() anywhere, the convert_pound function isn't defined. I wasn't aware of nested functions before your question, but reading the above on how the declaring function can only be called once, I feel they are best avoided. Does anyone have anyone have any examples where using them would be beneficial? E Ok.It was simply an oversight from my side.If I put a I get the two results clearly.Here is the clearer code : " . convert_pound(15); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error when calling nested function
Edward Kay wrote: Here's the list : I get the following error : *Fatal error*: Call to undefined function convert_pound() in ...*Untitled-1.php* on line *18 *line 18 is this one : echo convert_pound(15); From http://www.daaq.net/old/php/index.php?page=php+adv+functions&parent=php+flow +control: "When you define a function within another function it does not exist until the parent function is executed. Once the parent function has been executed, the nested function is defined and as with any function, accessible from anywhere within the current document. If you have nested functions in your code, you can only execute the outer function once. Repeated calls will try to redeclare the inner functions, which will generate an error." So, as you're not calling salestax() anywhere, the convert_pound function isn't defined. I wasn't aware of nested functions before your question, but reading the above on how the declaring function can only be called once, I feel they are best avoided. Does anyone have anyone have any examples where using them would be beneficial? E Ok.If I use the code below : I get no errors but I still get only the 1st line executed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Fatal error when calling nested function
> Here's the list : > > function salestax($price,$tax) { > function convert_pound($dollars, $conversion=1.6) { > return $dollars * $conversion; > } > $total = $price + ($price * $tax); > echo "Total cost in dollars: $total. Cost in British pounds: " > .convert_pound($total); > } > echo convert_pound(15); > ?> > > I get the following error : > > *Fatal error*: Call to undefined function convert_pound() in > ...*Untitled-1.php* on line *18 > > *line 18 is this one : echo convert_pound(15); > From http://www.daaq.net/old/php/index.php?page=php+adv+functions&parent=php+flow +control: "When you define a function within another function it does not exist until the parent function is executed. Once the parent function has been executed, the nested function is defined and as with any function, accessible from anywhere within the current document. If you have nested functions in your code, you can only execute the outer function once. Repeated calls will try to redeclare the inner functions, which will generate an error." So, as you're not calling salestax() anywhere, the convert_pound function isn't defined. I wasn't aware of nested functions before your question, but reading the above on how the declaring function can only be called once, I feel they are best avoided. Does anyone have anyone have any examples where using them would be beneficial? E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fatal error when calling nested function
Here's the list : I get the following error : *Fatal error*: Call to undefined function convert_pound() in ...*Untitled-1.php* on line *18 *line 18 is this one : echo convert_pound(15); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Fatal error: Call to undefined function hash_hmac()
Aaron Axelsen wrote: > We are running Novell SUSE Linux Enterprise Server 10 sp1. It has php > 5.1.2. We are using a standard out of the box install, and for some > reason the hash functions only work using the cli interface, and fails > to work with apache giving the following error: > > PHP Fatal error: Call to undefined function hash_hmac() > > Does anyone have any suggestions as to what might be causing this? The Apache and the CLI environments do have different setups - is it possible that the hash extension was not built into what apache is running? /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Fatal error: Call to undefined function hash_hmac()
We are running Novell SUSE Linux Enterprise Server 10 sp1. It has php 5.1.2. We are using a standard out of the box install, and for some reason the hash functions only work using the cli interface, and fails to work with apache giving the following error: PHP Fatal error: Call to undefined function hash_hmac() Does anyone have any suggestions as to what might be causing this? -- Aaron Axelsen [EMAIL PROTECTED] Great hosting, low prices. Modevia Web Services LLC -- http://www.modevia.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to a member function on a non-object
Not only that. think you are also passing the wrong parameters to the constructor. On Thu, 07 Dec 2006 15:48:10 +1030, Ryan Creaser <[EMAIL PROTECTED]> wrote: > > XeRnOuS ThE wrote: >> >> First, if a fatal error is occurring on line 24, why is it executing >> line 24 successfully and returning data? >> Second, if there’s a fatal error on line 24, why is line 25 still >> processed? >> > > Maybe because you're running it twice? Line 41 with the $this->Auth( ... > seems to be running the constructor again, it might be failing there? > > - rjc > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to a member function on a non-object
XeRnOuS ThE wrote: First, if a fatal error is occurring on line 24, why is it executing line 24 successfully and returning data? Second, if there’s a fatal error on line 24, why is line 25 still processed? Maybe because you're running it twice? Line 41 with the $this->Auth( ... seems to be running the constructor again, it might be failing there? - rjc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fatal error: Call to a member function on a non-object
I am working on a set of PHP framework so to speak, designed to create module based community & content management based scripts. I just started updating the authentication handlers, which are all PHP 4 classes, and reworking a long list of changes. The new version i am coding is near completely incompatible with the old version hence it is extremely hard for me to compare the new to the old for these errors. The problem here is PHP is returning the error "Fatal error: Call to a member function on a non-object in /home/thenubs/public_html/nauth7b/classes/Auth.class.php on line 24" Out of this I have two questions which are First, if a fatal error is occurring on line 24, why is it executing line 24 successfully and returning data? And second, if theres a fatal error on line 24, why is line 25 still processed? If anyone sees an alternative way to do what I am doing that might work better to solve the script errors then I am more than welcome to it as well seeing how my goal is just to get the script to run right. It seems like this might just be an error in PHP anyways, but I havent found anything on the net about similar occurrences yet. The explanation and all of the code that you should need in order to see whats going in is below. The output of the entire page is: SELECT userid, username, password FROM users WHERE username='XeRnOuS' Resource id #15 stdClass Object ( [userid] => 1 [username] => XeRnOuS [password] => $1$684gXdqL$MwtGhJGa7WkEbQoXe/474. ) 55 Fatal error: Call to a member function on a non-object in /home/thenubs/public_html/nauth7b/classes/Auth.class.php on line 24 Finally here is the code for the first part of the Auth class that i am working on. //set realtive variables for the sql, err, and perms classes into the current class for easy access. $this->sql = &$sql; $this->err = &$err; $this->perms = &$perms; $this->config = &$GLOBALS['config']; $userdat = $sql->fetch_object($sql->query("SELECT userid, username, password FROM users WHERE username='XeRnOuS'")); echo '';print_r($userdat); echo '55'; $this->authSID = session_id(); $this->userIP = $_SERVER['REMOTE_ADDR']; if(!is_object($this->sql)) echo '$sql IS NOT VALID OBJECT'; if(!method_exists($this->sql, 'query')) echo 'QUERY IS NOT A VALID METHOD'; //destroy timed-out login sessions. Standard users will stay logged for 1 hour before session is destroyed $time = time() - 60 * 60; #60 minutes * 60 seconds per minute = 1 hour ago. //if user is logged into the website, update it in $this->loggedIN for quick access for class //also change $this->userperms from guest permissions to $this->userID's specific permissions. if($_SESSION['loggedIN'] === true && !is_null($_SESSION['userID'])) { //check to see if user's session is still active in sql.auth_sessions if($this->Auth($_SESSION['userID'], session_id(), $_SESSION['userIP'])) { $this->userID = $_SESSION['userID']; $this->userperms = $this->perms->getUserPerms($this->userID); //check to see if sql.auth_sessions.flogout is set, force user logout if is //otherwise update sql.auth_sessions.lastaccess to current unix time stamp $userdat = $this->sql->fetch_object($this->sql->query("SELECT flogout FROM auth_sessions WHERE userID=\"$this->userID\" AND authSID=\"$this->authSID\" AND userIP=\"$this->userIP\"")); if($userdat->flogout === 1) { $this->Logout(); } else { $this->sql->query("UPDATE auth_sessions SET lastaccess=\"".time()."\" WHERE userID=\"$this->userID\" AND authSID=\"$this->authSID\" AND userIP=\"$this->userIP\""); } } else { //users session has timed out, unset session information, for auth, set userperms to guest permissions $_SESSION['loggedIN'] = false; $_SESSION['userID'] = null; $this->userperms = $perms->getGuestPerms(); } } else { //set user permissions file to guest permissions $this->userperms = $this->perms->getGuestPerms(); } return true;
[PHP] Fatal error: session_start(): Failed to initialize storage module
Hi, "Fatal error: session_start(): Failed to initialize storage module in /home/vernoncompany.biz/includes/validations.php on line 2" validation.php: #1 http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Fatal error: Call to a member function query() on a non-object in C:\Xampp\xa...
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: 28 June 2006 10:10 > Fatal error: Call to a member function query() on a > non-object in > C:\Xampp\xampp\htdocs\www2\knowledge_db\searchnew.php on line 81 > > Even though the $connection has already been established in a > other .php file. You can't do that -- there's simply no way to pass a database connection from one script to the next. > However, it should work since there is a > global declaration. That's not what a global declaration is about. Please go read the fine manual again: http://ch.php.net/manual/de/language.variables.scope.php#language.variab les.scope.global Cheers! Mike Mike Ford, Electronic Information Services Adviser, Learning Support Services, JG125, The Library, James Graham Building, Headingley Campus, Beckett Park, LEEDS, LS6 3QS, United Kingdom Tel: +44 113 283 2600 extn 4730Fax: +44 113 283 3211 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fatal error: Call to a member function query() on a non-object in C:\Xampp\xa...
Hello Following code shows within I have some difficulties. Is only an example from "Web Databasse Applications with PHP and MysQL" book. global $dsn; global $connection; $template->setCurrentBlock(); $template->setVariable("SUCH-KRITERIUM","Such-Kriterium: {$_SESSION["searchFormVars"]["search_eb"]}"); $browseString = "search_eb=" . urlencode($_SESSION["searchFormVars"]["search_eb"]); $search = ($_SESSION["searchFormVars"]["search_eb"]); $template->parseCurrentBlock(); $query = setupQuery($_SESSION["searchFormVars"]["search_eb"]); $result = $connection->query($query);--> This code shows me following error message, see below if (DB::isError($result)) trigger_error($result->getMessage(), E_USER_ERROR); $numRows = $result->numRows(); Fatal error: Call to a member function query() on a non-object in C:\Xampp\xampp\htdocs\www2\knowledge_db\searchnew.php on line 81 Even though the $connection has already been established in a other .php file. However, it should work since there is a global declaration. best regards, Joerg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs...
[EMAIL PROTECTED] wrote: > Hello > > I am pleased if someone could explain me the behaviour since is wrong the > following function call: ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, > $_SESSION["searchFormVars"]["offset"]+$rowCounter)); I am pleased if you'd off with the broken record (pun intended) georg - you have had the answer 6 times or more now. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs...
Hello I am pleased if someone could explain me the behaviour since is wrong the following function call: ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, $_SESSION["searchFormVars"]["offset"]+$rowCounter)); as you will find them below. By the way, fetchRow() is a method from class DB(.php). However mysql_fetch_row() should have same functionality but the argument resp. the identity is different. I hardly try to do not mix up functionality from mysql- with db- members. mysql_select_db("knowledge", $link); $query = setupQuery($_SESSION["searchFormVars"]["search"]); $result=mysql_query($query); for ( $rowCounter = 0; ($rowCounter < SEARCH_ROWS) && (( $rowCounter + $_SESSION["searchFormVars"]["offset"]) < mysql_num_rows($result)) && ($row = $result->fetchRow(DB_FETCHMODE_ASSOC, $_SESSION["searchFormVars"]["offset"]+$rowCounter)); $rowCounter++) { Error message: Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs\www2\knowledge_db\searchnew.php on line ... I am not shure that something should be wrong with the $result parameter since I have seen it in the PHP declaration and definition, see http://de.php.net/mysql_query below. I now that the return value of mysql_query is a boolean resp. a resource handler. In any case, I need the fetchRow functionality for correct work as listening to the rows on different pages. Another shorter possibility to print options of an ENUM as -tag: WHERE field=\'\''); while ($row=mysql_fetch_row($result)) { foreach(explode("','",substr($row[1],6,-2)) as $v) { print("$v"); } } ?> best regards, Georg
Re: [PHP] Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs...
Hmm. I wonder if his mail server is stuffed. Can we get this guy removed from the list? This is getting annoying :/ -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs...
Hello I am pleased if someone could explain me the behaviour since is wrong the following function call: ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, $_SESSION["searchFormVars"]["offset"]+$rowCounter)); as you will find them on the bottom of the email. By the way, fetchRow() is a method from class DB(.php). However mysql_fetch_row() should have same functionality but the argument resp. the identity is different. I hardly try to do not mix up functionality from mysql- with db- members. mysql_select_db("knowledge", $link); $query = setupQuery($_SESSION["searchFormVars"]["search"]); for ( $rowCounter = 0; ($rowCounter < SEARCH_ROWS) && (( $rowCounter + $_SESSION["searchFormVars"]["offset"]) < mysql_num_rows($result)) && ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, $_SESSION["searchFormVars"]["offset"]+$rowCounter)); $rowCounter++) { Error message: Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs\www2\knowledge_db\searchnew.php on line best regards, Georg
Re: [PHP] Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs...
[EMAIL PROTECTED] wrote: Hello I am pleased if someone could explain me the behaviour since is wrong the following function call: ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, $_SESSION["searchFormVars"]["offset"]+$rowCounter)); as you will find them on the bottom of the email. By the way, fetchRow() is a method from class DB(.php). However mysql_fetch_row() should have same functionality but the argument resp. the identity is different. I hardly try to do not mix up functionality from mysql- with db- members. $search = ($_SESSION["searchFormVars"]["search_eb"]); $link = mysql_connect("localhost", "root", "040573"); mysql_select_db("knowledge", $link); $query = setupQuery($_SESSION["searchFormVars"]["search"]); [EMAIL PROTECTED]($query); Error message: Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs\www2\knowledge_db\searchnew.php on line $result is not an object. mysql_query does not return an object, it returns a resource handler. Maybe you want mysqli_query ? Read the manual for both of these - there have been 3-4 replies telling you what the problem is. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs...
[EMAIL PROTECTED] wrote: > Hello > > I am pleased if someone could explain me the behaviour since is wrong the > following function call: ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, > $_SESSION["searchFormVars"]["offset"]+$rowCounter)); I'll explain your behaviour: you repeatedly ask the same question over and over whilst ignoring any/all previous replies to your question. here is another attempt: $result IS NOT A F***ING OBJECT, IT WILL NEVER BE AN OBJECT IN THE CODE YOU HAVE. ITS NOT AN OBJECT SO IT DOESN'T HAVE METHODS. $result IS THE RETURN VALUE OF mysql_query(). > as you will find them on the bottom of the email. By the way, fetchRow() is a > method from class DB(.php). However mysql_fetch_row() should have same > functionality but the argument resp. the identity is different. I hardly try > to do not mix up functionality from mysql- with db- members. > > > $search = ($_SESSION["searchFormVars"]["search_eb"]); > $link = mysql_connect("localhost", "root", "040573"); > > mysql_select_db("knowledge", $link); > > $query = setupQuery($_SESSION["searchFormVars"]["search"]); > > [EMAIL PROTECTED]($query); DON'T STICK @ SIGNS IN TO REPRESS ERRORS UNLESS IT'S A LAST RESORT (AND ONLY THEN WHEN YOU KNOW WHAT YOUR DOING). > > > > >for ( $rowCounter = 0; > ($rowCounter < SEARCH_ROWS) && > (( $rowCounter + $_SESSION["searchFormVars"]["offset"]) < > mysql_num_rows($result)) && >($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, > $_SESSION["searchFormVars"]["offset"]+$rowCounter)); ($row = mysql_fetch_assoc($result)) http://php.net/mysql_fetch_assoc >$rowCounter++) > { > > > Error message: > Fatal error: Call to a member function fetchRow() on a non-object in > C:\Xampp\xampp\htdocs\www2\knowledge_db\searchnew.php on line > DOES IT HELP IF I PUT IT IN CAPITALS? > > best regards, Georg > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs...
Hello I am pleased if someone could explain me the behaviour since is wrong the following function call: ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, $_SESSION["searchFormVars"]["offset"]+$rowCounter)); as you will find them on the bottom of the email. By the way, fetchRow() is a method from class DB(.php). However mysql_fetch_row() should have same functionality but the argument resp. the identity is different. I hardly try to do not mix up functionality from mysql- with db- members. $search = ($_SESSION["searchFormVars"]["search_eb"]); $link = mysql_connect("localhost", "root", "040573"); mysql_select_db("knowledge", $link); $query = setupQuery($_SESSION["searchFormVars"]["search"]); [EMAIL PROTECTED]($query); for ( $rowCounter = 0; ($rowCounter < SEARCH_ROWS) && (( $rowCounter + $_SESSION["searchFormVars"]["offset"]) < mysql_num_rows($result)) && ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, $_SESSION["searchFormVars"]["offset"]+$rowCounter)); $rowCounter++) { Error message: Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs\www2\knowledge_db\searchnew.php on line best regards, Georg
Re: [PHP] Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs...
[EMAIL PROTECTED] wrote: > Hello > > I am pleased if someone could explain me since is wrong the following > function call: ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, > $_SESSION["searchFormVars"]["offset"]+$rowCounter)); > as you will find them on the bottom of the email. By the way, fetchRow() is > an object from class DB(.php). However mysql_fetch_row() should have same > functionality but the argument resp. the identity is different. I hardly try > to do not mix up functionality from mysql- with db- members. > > > $search = ($_SESSION["searchFormVars"]["search_eb"]); > $link = mysql_connect("localhost", "root", "040573"); > > mysql_select_db("knowledge", $link); > > $query = setupQuery($_SESSION["searchFormVars"]["search"]); > > [EMAIL PROTECTED]($query); > > > > >for ( $rowCounter = 0; > ($rowCounter < SEARCH_ROWS) && > (( $rowCounter + $_SESSION["searchFormVars"]["offset"]) < > mysql_num_rows($result)) && >($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, > $_SESSION["searchFormVars"]["offset"]+$rowCounter)); >$rowCounter++) > { $result is not an object. why not lookup in the manual what mysql_query() returns you? as you have already been told: don't mix mysql_*() function called at random with calls to what seem to be PEAR DB methods. problems with PEAR should be directed to the pear specific list btw. > > > Error message: > Fatal error: Call to a member function fetchRow() on a non-object in > C:\Xampp\xampp\htdocs\www2\knowledge_db\searchnew.php on line > > > best regards, Georg > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs...
Hello I am pleased if someone could explain me since is wrong the following function call: ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, $_SESSION["searchFormVars"]["offset"]+$rowCounter)); as you will find them on the bottom of the email. By the way, fetchRow() is an object from class DB(.php). However mysql_fetch_row() should have same functionality but the argument resp. the identity is different. I hardly try to do not mix up functionality from mysql- with db- members. $search = ($_SESSION["searchFormVars"]["search_eb"]); $link = mysql_connect("localhost", "root", "040573"); mysql_select_db("knowledge", $link); $query = setupQuery($_SESSION["searchFormVars"]["search"]); [EMAIL PROTECTED]($query); for ( $rowCounter = 0; ($rowCounter < SEARCH_ROWS) && (( $rowCounter + $_SESSION["searchFormVars"]["offset"]) < mysql_num_rows($result)) && ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, $_SESSION["searchFormVars"]["offset"]+$rowCounter)); $rowCounter++) { Error message: Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs\www2\knowledge_db\searchnew.php on line best regards, Georg
Re: [PHP] PHP Fatal error: Unable to write base address in Unknown on line 0 ?
Open up a DOS shell and try to start Apache by hand. On Thu, June 1, 2006 7:42 am, Ilja Polivanovas wrote: > Hello, > > maybe someone know what can be the problem and how to solve it. It > appears > on startup of Apache, WinXP. > Apache doesn't start. > > -- > Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Fatal error: Unable to write base address in Unknown on line 0 ?
Ilja Polivanovas wrote: Hello, maybe someone know what can be the problem and how to solve it. It appears on startup of Apache, WinXP. Apache doesn't start. fron a quick google I would hazard a guess that your install is f***ed due to an earlier apache/php installation. either that or certain log files are not writable. try removing all installed stuff (apache, etc) and reinstalling from scratch. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Fatal error: Unable to write base address in Unknown on line 0 ?
Hello, maybe someone know what can be the problem and how to solve it. It appears on startup of Apache, WinXP. Apache doesn't start. -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function mysql_create_db()
This function is deprecated, and you ought to use mysql_query() to send the CREATE DB sql anyway -- So the book is either out-dated or just plain bad. If the function doesn't exist, then you either don't have MySQL extension to PHP installed, or your ISP has removed that function. On Sat, May 27, 2006 5:02 am, Mark Sargent wrote: > Hi All, > > I get the following, > > *Fatal error*: Call to undefined function mysql_create_db() in > */usr/local/apache2/htdocs/createmovie.php* on line 6 > > for this code, > > 5 //create the moviesite database > 6 mysql_create_db("moviesite") or die(mysql_error()); > > which is from a tutorial in the book I'm using. Any pointers? Code > looks > identical to the book's. Cheers. > > P.S. I also tried this, > > mysql_create_db("moviesite", $connect) or die(mysql_error()); > > and > > mysql_create_db("moviesite", "$connect") or die(mysql_error()); > > Mark Sargent. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Fatal error: Call to undefined function mysql_create_db()
//[dv] depricated //http://us2.php.net/manual/en/function.mysql-create-db.php //return mysql_create_db($name, $db); //[dv] this is not a good way to do this, as it doesn't tell you if it succeeded or not. //return mysql_query("CREATE DATABASE IF NOT EXISTS ".$name); //this returns error 1007 if it exists already return mysql_query("CREATE DATABASE ".$name); > -Original Message- > From: Mark Sargent [mailto:[EMAIL PROTECTED] > Sent: Saturday, May 27, 2006 3:03 AM > To: PHP List > Subject: [PHP] Fatal error: Call to undefined function > mysql_create_db() > > Hi All, > > I get the following, > > *Fatal error*: Call to undefined function mysql_create_db() in > */usr/local/apache2/htdocs/createmovie.php* on line 6 > > for this code, > > 5 //create the moviesite database > 6 mysql_create_db("moviesite") or die(mysql_error()); > > which is from a tutorial in the book I'm using. Any pointers? > Code looks > identical to the book's. Cheers. > > P.S. I also tried this, > > mysql_create_db("moviesite", $connect) or die(mysql_error()); > > and > > mysql_create_db("moviesite", "$connect") or die(mysql_error()); > > Mark Sargent. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function mysql_create_db()
Mark Sargent wrote: Peter Lauri wrote: Have you created a connection to the Server with the correct permissions? Hi All, sorry, meant to post that too, 1 3 $connect=mysql_connect("localhost", "root", "password omitted") or die("Hey, check your server connection."); I get no error for that line. Cheers. Hi All, seems that I was using a deprecated function. Cheers. Mark Sargent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function mysql_create_db()
Peter Lauri wrote: Have you created a connection to the Server with the correct permissions? Hi All, sorry, meant to post that too, 1 3 $connect=mysql_connect("localhost", "root", "password omitted") or die("Hey, check your server connection."); I get no error for that line. Cheers. Mark Sargent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function mysql_create_db()
On Sat, May 27, 2006 11:02, Mark Sargent wrote: > Hi All, > > > I get the following, > > > *Fatal error*: Call to undefined function mysql_create_db() in > */usr/local/apache2/htdocs/createmovie.php* on line 6 Sounds like you don't have the MySQL component of PHP installed. If you're using the packaged version for your OS (of PHP), check that you installed the php-mysql package (your package manager should let you search for it). If you're using a self-compiled PHP, sounds like you didn't compile in MySQL(i) support. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Fatal error: Call to undefined function mysql_create_db()
Have you created a connection to the Server with the correct permissions? -Original Message- From: Mark Sargent [mailto:[EMAIL PROTECTED] Sent: Saturday, May 27, 2006 5:03 PM To: PHP List Subject: [PHP] Fatal error: Call to undefined function mysql_create_db() Hi All, I get the following, *Fatal error*: Call to undefined function mysql_create_db() in */usr/local/apache2/htdocs/createmovie.php* on line 6 for this code, 5 //create the moviesite database 6 mysql_create_db("moviesite") or die(mysql_error()); which is from a tutorial in the book I'm using. Any pointers? Code looks identical to the book's. Cheers. P.S. I also tried this, mysql_create_db("moviesite", $connect) or die(mysql_error()); and mysql_create_db("moviesite", "$connect") or die(mysql_error()); Mark Sargent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fatal error: Call to undefined function mysql_create_db()
Hi All, I get the following, *Fatal error*: Call to undefined function mysql_create_db() in */usr/local/apache2/htdocs/createmovie.php* on line 6 for this code, 5 //create the moviesite database 6 mysql_create_db("moviesite") or die(mysql_error()); which is from a tutorial in the book I'm using. Any pointers? Code looks identical to the book's. Cheers. P.S. I also tried this, mysql_create_db("moviesite", $connect) or die(mysql_error()); and mysql_create_db("moviesite", "$connect") or die(mysql_error()); Mark Sargent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Unsupported operand types
Odds are really good that you are trying to add (+) something that ain't a number... Just print_r() each variable within that function and see what you did. On Sun, April 16, 2006 5:35 am, kmh496 wrote: > > can somebody explain why > > $this->param = $this->SYSTEM->db->answer + $this->param; > > is causing the error > > > Fatal error: Unsupported operand types > in /var/www/current/mjguest/modules/settings.php on line 52 > > > > context is > > > function settings(&$SYSTEM) > { > $this->SYSTEM = &$SYSTEM; > $this->SYSTEM->db->ask(1, 'settings_load'); > $this->SYSTEM->db->get_row(); > > $this->param = $this->SYSTEM->db->answer + $this->param; > } > > > > > -- > my site http://www.myowndictionary.com";>myowndictionary > was > made to help students of many languages learn them faster. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Unsupported operand types
kmh496 wrote: can somebody explain why $this->param = $this->SYSTEM->db->answer + $this->param; is causing the error no. because: a, you don't mention the version of php you use b, we don't have knowledge of you codebase (posting code listings for a complete class really isn't going to help much) have you tried to debug the problem? using print_r() or var_dump()? e.g.: ... Fatal error: Unsupported operand types in /var/www/current/mjguest/modules/settings.php on line 52 context is function settings(&$SYSTEM) { $this->SYSTEM = &$SYSTEM; $this->SYSTEM->db->ask(1, 'settings_load'); $this->SYSTEM->db->get_row(); echo ''; var_dump($this->SYSTEM->db->answer, $this->param) echo ''; $this->param = $this->SYSTEM->db->answer + $this->param; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Unsupported operand types
2006-04-16 (일), 21:02 +1000, chris smith 쓰시길: > On 4/16/06, kmh496 <[EMAIL PROTECTED]> wrote: > > 2006-04-16 (일), 19:35 +0900, kmh496 쓰시길: > > > can somebody explain why > > > > > > $this->param = $this->SYSTEM->db->answer + $this->param; > > > > > > is causing the error > > > > > > > > > Fatal error: Unsupported operand types > > > in /var/www/current/mjguest/modules/settings.php on line 52 > Sounds like you have a bad query and instead of answer being a row, > it's something else. > > Print out everything before you use it: > > instead of: > $this->param = $this->SYSTEM->db->answer + $this->param; > > $answer = $this->SYSTEM->db->answer; > $param = $this->param; > > echo "Answer: " . $answer . ""; > > If that's not an array, that's your problem and you'll have to debug > why it's not an array. > > -- list and especially dmajick @ gmail, thanks for your help. i will have to debug later, i am sorry, i have to run right now. frankly speaking, i am simply having a bad day. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Unsupported operand types
On 4/16/06, kmh496 <[EMAIL PROTECTED]> wrote: > 2006-04-16 (일), 19:35 +0900, kmh496 쓰시길: > > can somebody explain why > > > > $this->param = $this->SYSTEM->db->answer + $this->param; > > > > is causing the error > > > > > > Fatal error: Unsupported operand types > > in /var/www/current/mjguest/modules/settings.php on line 52 > > > > > > > > context is > > > > > > function settings(&$SYSTEM) > > { > > $this->SYSTEM = &$SYSTEM; > > $this->SYSTEM->db->ask(1, 'settings_load'); > > $this->SYSTEM->db->get_row(); > > > > $this->param = $this->SYSTEM->db->answer + $this->param; > > } > > > > > > > > > > -- > > what are they trying to do//? > > for what "does param mean" question, param is just above that part.. > > class settings > { > var $SYSTEM; > > var $param = array > > // Maximum length for web site title > ( 'titlelen' => 28 # DEFAULT: 28 # MAXIMUM: > 50 > > // Maximum length for administrator email > , 'adminmaillen' => 50 # DEFAULT: 50 # MAXIMUM: > 80 > > // Max Width and Height of avatars thumbnails (in pixels) > , 'userpic' => array > ( 'width' => 60 # Width in pixels # DEFAULT: > 60 # EDIT ACCORDING TO CUSTOM LAYOUT > , 'height'=> 60 # Height in pixels # DEFAULT: > 60 # EDIT ACCORDING TO CUSTOM LAYOUT > ) > > // Available date-time formats (valid patterns for php "date()" > function) > , 'dateformats' => array > ( 'd.m.Y h:ia'=> 'D.M.Y 12h' # Business > international > , 'm/d/Y h:ia'=> 'M/D/Y 12h' # American > , 'Y-m-j h:ia'=> 'Y-M-D 12h' # Asian > , 'd/m/Y H:i' => 'D/M/Y 24h' # European > , 'F, jS Y h:ia' => 'MM, Dth Y 12h' # English > , 'd.m.Y @ B .\b\e\a\t' => 'D.M.Y @ .beat' # Swatch(R) > Internet time > )# PATTERN => REPRESENTATION > ); > > function settings(&$SYSTEM) > { > $this->SYSTEM = &$SYSTEM; > $this->SYSTEM->db->ask(1, 'settings_load'); > $this->SYSTEM->db->get_row(); > > $this->param = $this->SYSTEM->db->answer + $this->param; > } > > > > > the db->answer is ... > >function ask() > { > $qparams = func_get_args(); > > $this->__lastquestion = $qparams[1]; > > $this->query($qparams[0], > strtr(vsprintf($this->questions[$qparams[1]], array_slice($qparams, 2)), > $this->tables)); > } > > function get_field($num = 0) > { > $this->answer = @mysql_fetch_row($this->__cachedquery); > > return ($this->answer ? $this->answer[$num] : > $this->__error()); > } > > function get_row() > { > $this->answer = @mysql_fetch_assoc($this->__cachedquery); > > return ($this->answer ? true : $this->__error()); > } Sounds like you have a bad query and instead of answer being a row, it's something else. Print out everything before you use it: instead of: $this->param = $this->SYSTEM->db->answer + $this->param; $answer = $this->SYSTEM->db->answer; $param = $this->param; echo "Answer: " . $answer . ""; If that's not an array, that's your problem and you'll have to debug why it's not an array. -- Postgresql & php tutorials http://www.designmagick.com/
Re: [PHP] Fatal error: Unsupported operand types
On 4/16/06, kmh496 <[EMAIL PROTECTED]> wrote: > > can somebody explain why > > $this->param = $this->SYSTEM->db->answer + $this->param; > > is causing the error > > > Fatal error: Unsupported operand types > in /var/www/current/mjguest/modules/settings.php on line 52 > > > > context is > > > function settings(&$SYSTEM) > { > $this->SYSTEM = &$SYSTEM; > $this->SYSTEM->db->ask(1, 'settings_load'); > $this->SYSTEM->db->get_row(); > > $this->param = $this->SYSTEM->db->answer + $this->param; > } What is $this->param set to initially? What is $this->SYSTEM->db->answer ? use gettype and see what they are: echo gettype($this->param) . ''; echo gettype($this->SYSTEM->db->answer) . ''; -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Unsupported operand types
2006-04-16 (일), 19:35 +0900, kmh496 쓰시길: > can somebody explain why > > $this->param = $this->SYSTEM->db->answer + $this->param; > > is causing the error > > > Fatal error: Unsupported operand types > in /var/www/current/mjguest/modules/settings.php on line 52 > > > > context is > > > function settings(&$SYSTEM) > { > $this->SYSTEM = &$SYSTEM; > $this->SYSTEM->db->ask(1, 'settings_load'); > $this->SYSTEM->db->get_row(); > > $this->param = $this->SYSTEM->db->answer + $this->param; > } > > > > > -- what are they trying to do//? for what "does param mean" question, param is just above that part.. class settings { var $SYSTEM; var $param = array // Maximum length for web site title ( 'titlelen' => 28 # DEFAULT: 28 # MAXIMUM: 50 // Maximum length for administrator email , 'adminmaillen' => 50 # DEFAULT: 50 # MAXIMUM: 80 // Max Width and Height of avatars thumbnails (in pixels) , 'userpic' => array ( 'width' => 60 # Width in pixels # DEFAULT: 60 # EDIT ACCORDING TO CUSTOM LAYOUT , 'height'=> 60 # Height in pixels # DEFAULT: 60 # EDIT ACCORDING TO CUSTOM LAYOUT ) // Available date-time formats (valid patterns for php "date()" function) , 'dateformats' => array ( 'd.m.Y h:ia'=> 'D.M.Y 12h' # Business international , 'm/d/Y h:ia'=> 'M/D/Y 12h' # American , 'Y-m-j h:ia'=> 'Y-M-D 12h' # Asian , 'd/m/Y H:i' => 'D/M/Y 24h' # European , 'F, jS Y h:ia' => 'MM, Dth Y 12h' # English , 'd.m.Y @ B .\b\e\a\t' => 'D.M.Y @ .beat' # Swatch(R) Internet time )# PATTERN => REPRESENTATION ); function settings(&$SYSTEM) { $this->SYSTEM = &$SYSTEM; $this->SYSTEM->db->ask(1, 'settings_load'); $this->SYSTEM->db->get_row(); $this->param = $this->SYSTEM->db->answer + $this->param; } the db->answer is ... function ask() { $qparams = func_get_args(); $this->__lastquestion = $qparams[1]; $this->query($qparams[0], strtr(vsprintf($this->questions[$qparams[1]], array_slice($qparams, 2)), $this->tables)); } function get_field($num = 0) { $this->answer = @mysql_fetch_row($this->__cachedquery); return ($this->answer ? $this->answer[$num] : $this->__error()); } function get_row() { $this->answer = @mysql_fetch_assoc($this->__cachedquery); return ($this->answer ? true : $this->__error()); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP: Fatal error: Allowed memory exhausted
Means not bad - if it's REALLY well controlled. But, to risky. :) Chris wrote: [EMAIL PROTECTED] wrote: ok, then. how "smart" is to do something like this? what's a bad side? Your memory will runaway and your script could potentially take over the server and slow everything down. Just like any other script could. [EMAIL PROTECTED] wrote: Hi, I'm working on the script that has to read csv file (51 column an a little bit over 3000 rows) with products and store the info in DB. Script works fine while I tested on csv files up to 200 records. And, when I tried to upload REAL data I got this. PHP: Fatal error: Allowed memory size of 8388608 bytes exhausted ... On google I found as a solution to put ini_set("memory_limit","12M"); on the top of the script, except allowed memory size wasn't 8m then 12m bytes. I tried with 16M and it worked :) My question is how "far" I can go with increasing? Where is "the limit"? Why is not 24M as default in php.ini? Thanks! -afan if you set the memory_limit to 0, then the script has unlimited memory to its disposal. Actually you need to set it to -1. http://www.php.net/manual/en/ini.core.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP: Fatal error: Allowed memory exhausted
[EMAIL PROTECTED] wrote: ok, then. how "smart" is to do something like this? what's a bad side? Your memory will runaway and your script could potentially take over the server and slow everything down. Just like any other script could. [EMAIL PROTECTED] wrote: Hi, I'm working on the script that has to read csv file (51 column an a little bit over 3000 rows) with products and store the info in DB. Script works fine while I tested on csv files up to 200 records. And, when I tried to upload REAL data I got this. PHP: Fatal error: Allowed memory size of 8388608 bytes exhausted ... On google I found as a solution to put ini_set("memory_limit","12M"); on the top of the script, except allowed memory size wasn't 8m then 12m bytes. I tried with 16M and it worked :) My question is how "far" I can go with increasing? Where is "the limit"? Why is not 24M as default in php.ini? Thanks! -afan if you set the memory_limit to 0, then the script has unlimited memory to its disposal. Actually you need to set it to -1. http://www.php.net/manual/en/ini.core.php -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP: Fatal error: Allowed memory exhausted
hm. it looks like set_time_limit(0); ok, then. how "smart" is to do something like this? what's a bad side? > [EMAIL PROTECTED] wrote: >> Hi, >> I'm working on the script that has to read csv file (51 column an a >> little >> bit over 3000 rows) with products and store the info in DB. >> Script works fine while I tested on csv files up to 200 records. >> And, when I tried to upload REAL data I got this. >> PHP: Fatal error: Allowed memory size of 8388608 bytes exhausted ... >> >> On google I found as a solution to put >> ini_set("memory_limit","12M"); >> on the top of the script, except allowed memory size wasn't 8m then 12m >> bytes. >> I tried with 16M and it worked :) >> >> My question is how "far" I can go with increasing? Where is "the limit"? >> Why is not 24M as default in php.ini? >> >> Thanks! >> >> -afan >> > if you set the memory_limit to 0, then the script has unlimited memory > to its disposal. > > Cheers > /V > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP: Fatal error: Allowed memory exhausted
Spread sheet is 2M, but 12M wasn't enough. this is the code getting data from csv: $fp = fopen ('/var/www/html/afan.com/admin/tmp/'.$SpreadSheetFile,"r"); while ($data = fgetcsv ($fp, 5, ",")) { $num = count ($data); for ($c=0; $c<$num; $c++) { $PRODUCTS[$row][$c] = $data[$c]; } ++$row; } fclose ($fp); Then each row from array $PRODUCT checking if such a product no. exists and if no insert into DB, select_id(), insert into two other tables (categories and prices). > [EMAIL PROTECTED] wrote: >> Hi, >> I'm working on the script that has to read csv file (51 column an a >> little >> bit over 3000 rows) with products and store the info in DB. >> Script works fine while I tested on csv files up to 200 records. >> And, when I tried to upload REAL data I got this. >> PHP: Fatal error: Allowed memory size of 8388608 bytes exhausted ... >> >> On google I found as a solution to put >> ini_set("memory_limit","12M"); >> on the top of the script, except allowed memory size wasn't 8m then 12m >> bytes. >> I tried with 16M and it worked :) >> >> My question is how "far" I can go with increasing? Where is "the limit"? >> Why is not 24M as default in php.ini? >> >> Thanks! >> >> -afan >> >> > I think 16m should be enough in most cases.. > > Would like to see the script. Try to avoid reading large files in once > file() file_get_contents0. > Use fopen en fgets. I work with txt files over 40 m and hardly get 1 m > of memory usage. > > You could also try to run the program with the unix nice command. Just > don't think > increasing is a solution. What if you get a 300 m csv file? Well just my > 2 cents. > > Thijs > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP: Fatal error: Allowed memory exhausted
[EMAIL PROTECTED] wrote: > Hi, > I'm working on the script that has to read csv file (51 column an a little > bit over 3000 rows) with products and store the info in DB. > Script works fine while I tested on csv files up to 200 records. > And, when I tried to upload REAL data I got this. > PHP: Fatal error: Allowed memory size of 8388608 bytes exhausted ... > > On google I found as a solution to put > ini_set("memory_limit","12M"); > on the top of the script, except allowed memory size wasn't 8m then 12m > bytes. > I tried with 16M and it worked :) > > My question is how "far" I can go with increasing? Where is "the limit"? > Why is not 24M as default in php.ini? > > Thanks! > > -afan > > I think 16m should be enough in most cases.. Would like to see the script. Try to avoid reading large files in once file() file_get_contents0. Use fopen en fgets. I work with txt files over 40 m and hardly get 1 m of memory usage. You could also try to run the program with the unix nice command. Just don't think increasing is a solution. What if you get a 300 m csv file? Well just my 2 cents. Thijs -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP: Fatal error: Allowed memory exhausted
Hi, I'm working on the script that has to read csv file (51 column an a little bit over 3000 rows) with products and store the info in DB. Script works fine while I tested on csv files up to 200 records. And, when I tried to upload REAL data I got this. PHP: Fatal error: Allowed memory size of 8388608 bytes exhausted ... On google I found as a solution to put ini_set("memory_limit","12M"); on the top of the script, except allowed memory size wasn't 8m then 12m bytes. I tried with 16M and it worked :) My question is how "far" I can go with increasing? Where is "the limit"? Why is not 24M as default in php.ini? Thanks! -afan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fatal error: Call to undefined function preg_match()
Hi all! Recently I am getting the following error on some of my PHP-enabled websites. I think it started when I went from PHP4 -> PHP5. Here is an example (from http://wos.poboxes.info/) : Fatal error: Call to undefined function preg_match() in /var/www/wos.poboxes.info/htdocs/classes/ConfigData.php on line 114 What causes this? How can I fix it? FYI: I use Cherokee (not Apache...) Regards, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error 'Unable to read from thread kernel pipe' when using mail() function
On Fri, Dec 16, 2005 at 03:07:20PM +, Stut wrote: > Hi All, > > I've just upgraded the PHP port installation on my server to v4.4.1 and > the mail function has stopped working. I created a script that simply > calls the mail function to send a test email ad this is what I get when > I run it... > > [EMAIL PROTECTED]:~$ php test.php > Fatal error 'Unable to read from thread kernel pipe' at line 1100 in > file /usr/src/lib/libc_r/uthread/uthread_kern.c (errno = 0) > Abort trap (core dumped) This is a new one for me. > > I've googled for this error and all references I found that related to > PHP basically say that it's due to Apache and PHP being compiled in > different threading modes. This cannot be the case in this instance > since Apache is using the preform MPM and even if it wasn't it's > happening on the CLI where Apache is not involved. I'm thinking it has to do with the threading modes handled by the bsd kernel: libkse, libc_r, libthr. If say apache was compiled with libkse and php with libc_r, this is the kind of threading conflict i think could occure. > Any clues people might have as to the cause of this problem would be > gratefully received. > > FYI: OS is FreeBSD v5.2 and Apache if v2.0.55 If you are doing this on a cvsup'd port, there could have been major changes, you are using the portupgrade tool to install these ports right? I would search the bsd-ports or bsd-general mailing lists to see if this there is anything related, and also you could try the bsd specific google search: http://google.com/bsd HTH, Curt. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error 'Unable to read from thread kernel pipe' when using mail() function
I assume the lack of response to this means that nobody has come across this problem before? Any pointers would be helpful - I'm losing hair fast!! Cheers. -Stut On 16/12/05, Stut <[EMAIL PROTECTED]> wrote: > > Hi All, > > I've just upgraded the PHP port installation on my server to v4.4.1 and > the mail function has stopped working. I created a script that simply > calls the mail function to send a test email ad this is what I get when > I run it... > > [EMAIL PROTECTED]:~$ php test.php > Fatal error 'Unable to read from thread kernel pipe' at line 1100 in > file /usr/src/lib/libc_r/uthread/uthread_kern.c (errno = 0) > Abort trap (core dumped) > > The email gets sent successfully on the CLI despite crashing. When the > mail function is called from a web page it never gets sent and the > script never finishes. > > I've googled for this error and all references I found that related to > PHP basically say that it's due to Apache and PHP being compiled in > different threading modes. This cannot be the case in this instance > since Apache is using the preform MPM and even if it wasn't it's > happening on the CLI where Apache is not involved. > > Any clues people might have as to the cause of this problem would be > gratefully received. > > FYI: OS is FreeBSD v5.2 and Apache if v2.0.55 > > Cheers. > > -Stut > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
[PHP] Fatal error 'Unable to read from thread kernel pipe' when using mail() function
Hi All, I've just upgraded the PHP port installation on my server to v4.4.1 and the mail function has stopped working. I created a script that simply calls the mail function to send a test email ad this is what I get when I run it... [EMAIL PROTECTED]:~$ php test.php Fatal error 'Unable to read from thread kernel pipe' at line 1100 in file /usr/src/lib/libc_r/uthread/uthread_kern.c (errno = 0) Abort trap (core dumped) The email gets sent successfully on the CLI despite crashing. When the mail function is called from a web page it never gets sent and the script never finishes. I've googled for this error and all references I found that related to PHP basically say that it's due to Apache and PHP being compiled in different threading modes. This cannot be the case in this instance since Apache is using the preform MPM and even if it wasn't it's happening on the CLI where Apache is not involved. Any clues people might have as to the cause of this problem would be gratefully received. FYI: OS is FreeBSD v5.2 and Apache if v2.0.55 Cheers. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php