Compile php 4


#1

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


#2

help me


#3

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.


yerba# rm -rf /etc
yerba#


#4

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


#5

Vendetta already asked these questions in a related thread.


Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]


#6

Well geez… Vendetta, why didn’t you check that related thread. It labels your problem exactly. :slight_smile:

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.


yerba# rm -rf /etc
yerba#


#7

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.


#8

but Dreamhost is the only webserver with this function disable


#9

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.


Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]


#10

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…


#11

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?


yerba# rm -rf /etc
yerba#


#12

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.


yerba# rm -rf /etc
yerba#


#13

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


#14

i have send an e-mail to the person where i have buy the script…not at Dreamhost support, i’m not so stupid


#15

[quote]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
[/quote]
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 [color=#CC0000]SCJESSEY97[/color]


#16

[quote]3. Is there any reason why you cannot use mod_include instead of virtual() to include your CGI script? For example:

[/quote]
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.


yerba# rm -rf /etc
yerba#


#17

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?


Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]


#18

Convert it to PHP. :slight_smile:

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.


yerba# rm -rf /etc
yerba#


#19

Yeah, that is what I figured. I’m not a fan of the custom PHP route myself.


Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]


#20

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 ?