Disabled PHP functions?

software development

#1

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

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


#2

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?


#3

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


#4

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.


#5

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!

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


#6

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

si-blog
Max discount on any plan with promocode SCJESSEYTOTAL