RE: Problems with file_get_contents() and local PHP file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nice to hear that!

If you expect heavy traffic on the site using that script you might want try
to save some DNS and http connection overhead by stating the url with
http://localhost/ and so on. Given that the server's OS is unix based, it
may also work to execute the php-script like a shell script if the php
environment is set accordingly. 
In case of a image processing script, this may take a huge load of work away
from your apache or wahterver server, and restrict it to the php processor
only. 
(the data stream won't be routed over the internet deamon and the webserver
on port 80)

In order to do so, try 
$buffer = `php /var/www/thescript.php`; // or whatever location your script
is in ...
Instead of 
$buffer = file_get_contents("http://localblah...";);

But if it's a rented server, apache overhead isn't your concern, so go on
and let your provider worry about it! :-D

Jan



-----Original Message-----
From: Mike [mailto:zmen8@xxxxxxx] 
Sent: Monday, August 06, 2007 12:45 AM
To: php-general@xxxxxxxxxxxxx
Subject: Re:  Problems with file_get_contents() and local PHP file

Hah, it works! I had to fiddle around a few other errors but that did the 
trick! Thank you so much. :)

-Mike 

-- 
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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux