Disabled PHP functions?

Disabled PHP functions?

Posted by: Sakoda
Posted on: 2008-04-02 15:51:00

I don't know much PHP at all, but I've been trying to get a script to work on my server. I get the following error which I believe is the work of DreamHost disabling some PHP functions. Keep in mind I'm using PHP 5.x

In reply to:

Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of xml_set_object(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in .../killboard/mods/value_fetch/fetcher.php on line 86


Is the only possible way to get this function to work creating your own php.ini file?

Re: Disabled PHP functions?

Posted by: Alpicola
Posted on: 2008-04-02 16:25:00

If I'm remembering right, "call-time pass by reference" is a feature of older versions of PHP that has is disfavored as of PHP 5. Newer functions that need to pass by reference should use reference parameters instead, as detailed in the PHP documentation.

Is this a function you're trying to call yourself, or is it part of some third party software package? If it's the former, you can modify the code easily enough to not use call-time pass by reference. If the latter, which package are you trying to use?

Re: Disabled PHP functions?

Posted by: rlparker
Posted on: 2008-04-02 17:00:00

ALpicola is correct about it being a PHP5 version issue with that method being deprecated.

In addition to alpicola's relevant comments, one "quick and dirty" way to resolve the particular issue are are talking about, without having to muck about with php.ini, is to just switch to using DreamHost's PHP4 version for use on your domain.

While this would likely be far more "compatible" with your application, it really is "a step backward" and really only postpones dealing with the problem (PHP4 is mot going to be supported forever!). Additionally, note that DreamHost's PHP4 is configured with register_globals set to On, which can be a considerable security risk (depending upon how well your application, and other PHP scripts on your site, are "hardened").

--rlparker

Re: Disabled PHP functions?

Posted by: Sakoda
Posted on: 2008-04-02 18:28:00

It's a third party script, as like I said I don't know much PHP myself. If I set it back to PHP 4, I need to use fopen(), which I know is not supported by DreamHost, and I'm not quite daring enough considering my lack of experience building my own .ini file.

Re: Disabled PHP functions?

Posted by: rlparker
Posted on: 2008-04-02 19:46:00

Well, "fopen" is similarly crippled in the DreamHost PHP5 as it is in the DreamHost PHP4 (allow_url_fopen, and related is not available), so what works in one should work in the other. wink

fopen itself *is* supported by DreamHost, just not certain uses of it!

In reply to:

I'm not quite daring enough considering my lack of experience building my own .ini file.


If you follow the steps in the wili carefully and precisely, it is not hard to do, so you should not be afraid to try it... what you should be concerned about is enabling a potentially dangerous setting if you do not understand the risk and how to mitigate it.

There is even a "simpler" way to modify the php.ini file than the "main" article - just search for "custom php.ini" wink

--rlparker

Re: Disabled PHP functions?

Posted by: scjessey
Posted on: 2008-04-03 07:50:00

What is the script? If it is open source, maybe it might be possible to help you adapt it.

-- si-blog --

Tags: php functionsini filedreamhostreply