Compile php 4
Posted by: Vendetta
Posted on: 2006-05-31 11:48:00
Can i compile php 4 like you say here to working with "virtual include" and "file_get_contents" ?
http://wiki.dreamhost.com/index.php/Custom_compile_PHP_4
Posted by: Vendetta
Posted on: 2006-05-31 11:48:00
Can i compile php 4 like you say here to working with "virtual include" and "file_get_contents" ?
http://wiki.dreamhost.com/index.php/Custom_compile_PHP_4
Posted by: Vendetta
Posted on: 2006-05-31 14:50:00
help me
Posted by: guice
Posted on: 2006-05-31 14:55:00
get_file_contents will work with DH's install just fine. It's URL contents that will not (ie, "files" that start with http:// or ftp://).
virtual include will not work. That is only possible through mod_php. It's irrelevant in PHP's world anyway with all the possible ways to include a file. The only reason you'd want to virtually include a file is if it's not a PHP file.
Posted by: Vendetta
Posted on: 2006-05-31 15:00:00
file_get_contents not work with me, i received this errror in my installs cript:
Creating new cache file...
Warning: file_get_contents(): URL file-access is disabled in the server configuration
I must user virtual to include a CGI application in my blog
Posted by: scjessey
Posted on: 2006-05-31 15:01:00
Vendetta already asked these questions in a related thread.
Posted by: guice
Posted on: 2006-05-31 15:06:00
Well geez.. Vendetta, why didn't you check that related thread. It labels your problem exactly. ^_^
I do have to question the reasons for installing a custom PHP. If you're a complete newbie, I would highly recommend NOT installing a custom PHP.
The reasons why certain things are removed from DH's install is due to security issues from new PHP developers and poorly written scripts. If you're trying to install a custom PHP to get around those security issues, you best know what those security issues are and how to prevent them yourself.
Posted by: Vendetta
Posted on: 2006-05-31 15:07:00
yes, but with mod_php i have a problem on other script with exec() function....i must work with php as CGI with virtual and file_get_contents enable.
Posted by: Vendetta
Posted on: 2006-05-31 15:12:00
but Dreamhost is the only webserver with this function disable
Posted by: scjessey
Posted on: 2006-05-31 15:12:00
In reply to:yes, but with mod_php i have a problem on other script with exec() function....i must work with php as CGI with virtual and file_get_contents enable.
Your only solution is to go with PHP running as a CGI application, and then use alternatives to virtual() and file_get_contents(). The latter has many alternatives, and I am pretty sure you can code around the lack of virtual() as well.
Posted by: Vendetta
Posted on: 2006-05-31 15:18:00
i don't have alternative, i have tried mod_php and another script didn't work, the only way is use virtual for include the
CGI file, or change script.
But in another forum have said me to compile PHP for working with virtual include.
For file_get_contents i have send an e-mail to the support of the script to ask a modified for it....
Posted by: guice
Posted on: 2006-05-31 15:18:00
In reply to:but Dreamhost is the only webserver with this function disable
DH is also one of the few servers with a PHP5 install.
DH folks actually know security. This is one reason I've been with DH for near 3 years now. They know what they're doing. I like that.
You're in a dilemma. As it was stated in the above and the other thread, you cannot have both. You want virtual(), but it's only works with mod_php (PHP4). You want URL File open, but it's not enabled on any DH PHP install.
You gotta make a choice. Which is more important? virtual() or URL File Open?
Posted by: guice
Posted on: 2006-05-31 15:22:00
In reply to:For file_get_contents i have send an e-mail to the support of the script to ask a modified for it....
That won't happen. I'm sorry. They are there for server support. Not writing your scripts. If you cannot alter the script yourself, ask the author of the script. If they cannot, then you need to find an alternative.
And there is no chance they'll turn on allow_url_fopen specifically for your site. It's just not possible.
Posted by: Vendetta
Posted on: 2006-05-31 15:30:00
i have three different script:
1] a tracking script with get_file_contents problem
2] another script with exec() problem when you use mod_php
3] a CGI script to include in my blog with virtual function
Posted by: Vendetta
Posted on: 2006-05-31 15:32:00
i have send an e-mail to the person where i have buy the script...not at Dreamhost support, i'm not so stupid
Posted by: scjessey
Posted on: 2006-05-31 18:00:00
In reply to:1] a tracking script with get_file_contents problem
2] another script with exec() problem when you use mod_php
3] a CGI script to include in my blog with virtual function
Use the CGI binary version...
1. Use cURL.
2. exec() will work.
3. Is there any reason why you cannot use mod_include instead of virtual() to include your CGI script? For example:
<!--#include virtual="/path/to/cgi/script.cgi" -->
--------
Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code SCJESSEY97
Posted by: guice
Posted on: 2006-05-31 18:07:00
In reply to:3. Is there any reason why you cannot use mod_include instead of virtual() to include your CGI script? For example:
Only works in SSI parsed HTML documents. ie, not in PHP files. You'll have to use URL fopen to make apache parse the SSI document, which is also disabled, in DH's PHP.
Posted by: scjessey
Posted on: 2006-05-31 18:26:00
In reply to:Only works in SSI parsed HTML documents. ie, not in PHP files. You'll have to use URL fopen to make apache parse the SSI document, which is also disabled, in DH's PHP.
You are absolutely right - I didn't really think that through properly. Of course, you can always adapt cURL to do that as well. What is the best way to include a CGI script within a PHP document?
Posted by: guice
Posted on: 2006-05-31 19:21:00
Convert it to PHP. ^_^
Else, just use cURL or a custom PHP with allow_url_fopen enabled.
All options, imo, require knowledge of programming and development to accomplish. You can get away with installing the custom PHP and using allow_url_fopen. Since it's a commercial app, Vendetta can get support for any possible security holes that might encounter from it. allow_url_fopen was turned off cause of script kiddies that don't know how to properly filter incoming request data.
Posted by: scjessey
Posted on: 2006-06-01 04:10:00
In reply to:Else, just use cURL
Yeah, that is what I figured. I'm not a fan of the custom PHP route myself.
Posted by: Vendetta
Posted on: 2006-06-01 08:56:00
This is the line where i receive error:
echo "Creating new cache file...";
flush();
$path = dirname($_SERVER['PHP_SELF']);
$file="http://".$_SERVER['PHP_AUTH_USER']. ":".$_SERVER['PHP_AUTH_PW']. "@" .$_SERVER['HTTP_HOST']. "$path/index.php?conf=$conf&mc=1";
//echo $file;
$source=file_get_contents($file);
$filename = "$tmpdir$conf.html";
$fp = fopen ($filename,"w+");
fwrite ($fp, $source);
fclose ($fp);
I'm not a scripter, someone can help me to modify for working with curl ?
Posted by: scjessey
Posted on: 2006-06-01 09:03:00
In reply to:echo "Creating new cache file...";
flush();
$path = dirname($_SERVER['PHP_SELF']);
$file="http://".$_SERVER['PHP_AUTH_USER']. ":".$_SERVER['PHP_AUTH_PW']. "@" .$_SERVER['HTTP_HOST']. "$path/index.php?conf=$conf&mc=1";
//echo $file;
$source=file_get_contents($file);
$filename = "$tmpdir$conf.html";
$fp = fopen ($filename,"w+");
fwrite ($fp, $source);
fclose ($fp);
This is almost exactly the same as the example on the wiki. Here's an update version with cURL:
echo "Creating new cache file...";
flush();
$path = dirname($_SERVER['PHP_SELF']);
$file="http://".$_SERVER['PHP_AUTH_USER']. ":".$_SERVER['PHP_AUTH_PW']. "@" .$_SERVER['HTTP_HOST']. "$path/index.php?conf=$conf&mc=1";
//echo $file;
$ch = curl_init();
$timeout = 5;
curl_setopt ($ch, CURLOPT_URL, $file);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$source = curl_exec($ch);
curl_close($ch);
$filename = "$tmpdir$conf.html";
$fp = fopen ($filename,"w+");
fwrite ($fp, $source);
fclose ($fp);
--------
Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code SCJESSEY97
Posted by: Vendetta
Posted on: 2006-06-01 09:38:00
Fantastic!!! Now works!! Many thanks bro :)
Posted by: scjessey
Posted on: 2006-06-01 09:39:00
In reply to:Fantastic!!! Now works!! Many thanks bro :)
You're welcome.
Posted by: Vendetta
Posted on: 2006-06-01 09:49:00
Can i include the shtml file with the virtual include in my php script ?? I had have this idea :)
Posted by: scjessey
Posted on: 2006-06-01 10:05:00
In reply to:Can i include the shtml file with the virtual include in my php script ?
No. SSI stuff will not work. You will need to use cURL for that as well (see earlier in the thread).
Posted by: ardco
Posted on: 2006-06-01 10:55:00
> Can i include the shtml file with the virtual include in my php script ??
In case it might help, you can include a php file with include virtual in an shtml page.
What I Like About