php-windows Digest 31 Mar 2007 12:20:01 -0000 Issue 3177

Topics (messages 27607 through 27608):

Re: Log message - is everything ok with it?
        27607 by: Stut

Re: php include problem
        27608 by: trystano.aol.com

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        php-windows@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
burning shadow wrote:
I found this message in log when my script crashed:

[Fri Mar 30 16:29:42 2007] [error] [client 192.168.0.100] PHP Fatal
error:  Allowed memory size of 33554432 bytes exhausted (tried to
allocate 3456 bytes) in
D:\\root\\mygal.net.ru\\minigal\\includes\\mg2admin_functions.php on
line 441, referer: http://mygal.net.ru/minigal/admin.php

How can 3456 bytes exhaust 32 megabytes? Is it a bug or just a mistake
in error message?

It means that the error occurred when it tried to allocate 3456 bytes on top of everything it had already allocated. The extra 3456 took it over the 32meg limit. So no, everything is not ok with it.

-Stut

--- End Message ---
--- Begin Message ---
 Yeah, thats the best way, to use a constant as you will only need to change it 
in one place if the location of the images need to change in the future. Also, 
I would'nt hard code your domain into the location path of the images as they 
won't work locally for testing (localhost). You probs best off using the 
variables that fall under $_SERVER for determining your application root.
 
 Tryst
    
 -----Original Message-----
 From: [EMAIL PROTECTED]
 To: php-windows@lists.php.net
 Sent: Thu, 29 Mar 2007 12.38PM
 Subject: RE: [PHP-WIN] php include problem
 
  I do this little trick in the main file I include in all my php files. So 
after 
that, I only use the constants regardless how deep I am in a folder.

//pour trouver comment/ou inclure les fichiers peut importe l'emplacement du 
fichier appelant
    if (!defined("SERVER_ROOT_PATH"))
    {    
        settype($str_pathUp, "string");
        $str_pathUp = str_repeat("../", substr_count($_SERVER['PHP_SELF'], 
"/")-2);    
        //on construit le chemin des fichiers       
        DEFINE("SERVER_ROOT_PATH", $str_pathUp);
        DEFINE("SERVER_FILE_PATH", SERVER_ROOT_PATH."fichier/");
        DEFINE("SERVER_INCLUDEFILE_PATH", SERVER_ROOT_PATH."includeFiles/");
        DEFINE("SERVER_IMAGE_PATH", SERVER_ROOT_PATH."image/");
        DEFINE("SERVER_CSS_PATH", SERVER_ROOT_PATH."css/");
        DEFINE("SERVER_TEMP_PATH", SERVER_ROOT_PATH."temp/");
        DEFINE("SERVER_LOG_PATH", SERVER_ROOT_PATH."log/");
        DEFINE("SERVER_CLASS_PATH", SERVER_ROOT_PATH."classe/");
        DEFINE("SERVER_ADODB_CLASS_PATH", SERVER_CLASS_PATH."adodb/");
        DEFINE("SERVER_MAIL_CLASS_PATH", SERVER_CLASS_PATH."mail/");
        DEFINE("SERVER_NEWMAIL_CLASS_PATH", SERVER_CLASS_PATH."phpmailer/");
        DEFINE("SERVER_ERROR_CLASS_PATH", SERVER_CLASS_PATH."errorHandler/");
        DEFINE("SERVER_SESSION_CLASS_PATH", SERVER_CLASS_PATH."session/");
        DEFINE("SERVER_SQL_CLASS_PATH", SERVER_CLASS_PATH."sqlWrapper/");
    }
    
    // Fonctions générales nécessaires à certaines classes.
    include_once(SERVER_INCLUDEFILE_PATH.'module_fonction_generale.php');





-----Message d'origine-----
De : Niel Archer [mailto:Niel Archer] De la part de Niel Archer
Envoyé : 28 mars 2007 21:32
À : php-windows@lists.php.net
Objet : Re: [PHP-WIN] php include problem

Hi

> When including try using ./new/images instead of /new/images
> 
> the . should tell it to start at root level.

No. the '.' tells it to start at current directory. '../' would tell it
to start at the parent directory (one level higher) so:

 "../images/"
 would work in this example.

bob's advice to use absolute paths would be safest though...

"www.your-domain.com/images/"



Niel

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   

--- End Message ---

Reply via email to