Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change php settings (without access to php.ini)

Status
Not open for further replies.

tiamat2012

Programmer
Dec 12, 2004
144
US
Is there a standard way to do it? I heard .htaccess is deprecated, though I'm not quite sure.

My webpage is giving me these errors:

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). 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. However, future versions may not support this any longer. in \\192.168.1.16\webfiles\files\2006-3\719045\chip\chip.php on line 365

this repeats over and over, the same thing, then there is


Warning: fopen(): URL file-access is disabled in the server configuration in \\192.168.1.16\webfiles\files\2006-3\719045\chip\chip.php on line 1559

and when I checked my server php settings, it verified:
Directive Local Value Master Value
allow_call_time_pass_reference Off Off
allow_url_fopen Off Off

and don't know if this has anything important, but:
safe_mode On On

Would greatly appreciate help,
Kerry
 
some webservers (particularly those using CGI) allow local php.ini to override certain master settings.

try adding a php.ini to the directory that your calling script is in with the
Code:
allow_call_time_pass_reference = 1
allow_url_fopen = 1

you can also (I believe) set the first item in php
Code:
ini_set ("allow_call_time_pass_reference", "1");
the second cannot be set in php and must be set in php.ini
 
hmmm ok.

The ini_set worked for one of my pages, but when I applied it to chip.php it didn't quite go over so well. I think what i'm going to try to do is use .htaccess to look at my php.ini file (I uploaded it, but it didn't read it), which I found a page that describes how to do, unless you have another suggestion?

-Kerry
 
thick of me. it's not a binary switch but a literal switch.

try
Code:
ini_set ("allow_call_time_pass_reference", "On");

shove it at the top of php.net.

or put an .htaccess file in place in the relevant directory
Code:
phpflag allow_call_time_pass_reference On

[i'm not certain this flag can be set in htaccess but it's worth a shot. the ini_set DEFINITELY works though.
 
php.net? Where is that? (is it a standard php file? and if so, should I copy my personal one and upload it to the server?)

Also, in the .htaccess file, I don't have one yet, should I set up a normal one then add it, or if I just stick that it and name it .htaccess will it work?

-Kerry
 
my boo boo. for php.net read php file.

.htaccess file is just text. just create it and shove it up on the server. remember it affects the current directory and all subs.
 
php file" php.ini? sorry I feel really ignorant right now

Ok, I tried the .htaccess, didn't work so well, so I decided that i might be my free hosting, so I switched to another place, and voila! It all worked!

Thank you,
Kerry
 
shove it at the top of php.net.

i really did mean any php file. the ini_set functions are temporary in scope. you need to include the line in any code that will rely on the temporary setting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top