file_get_contents() can't fetch files via HTTP from localhost's vhosts

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

 



Hello all,

I have a dynamically generated javascript library that I want to minigy with a PHP port of JSMin, in order to do that I need to first fetch the parsed PHP script that generates the JS (complete with comments and everything), and then minify it.

The idea is to fetch the file via file_get_contents("http://www.vhost.dev/output.php";). This way the file gets parsed by PHP within the working environment (in respect of all paths, session policies etc..). It works flawlessly across domains, but it fails to fetch the file if the domain is a locally hosted apache vhost.

Needless to say, I tried to add the host resolution to /etc/hosts, and lynx has no problem to fetch the page.

if I try to execute a passthrough() with the command "php5-cgi /path/to/script.php" it breaks auth saving session files.

Any idea how I can achieve parsing with php the contents of the script before manipulating it? (The script is too complex to assign it as a string to a php variable, which would otherwise empower me to minify it without further troubles).

Thanks,

Burn

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