PDA

View Full Version : Allowing url_fopen


LightScribe
10-21-2007, 02:30 AM
I am trying to install a modification to my vBulletin forum which allows users to purchase and sell stocks with the forum's currency based on real stock prices. The prices are grabbed from the yahoo financial server.

Unfortunately, my host has allow_url_fopen set to off on the server. However, after talking to them they have told me I can edit the setting locally using a .htaccess file. They told me they couldn't give me instructions on doing so, but I believe that I just need to create a .htaccess file in my root directory which contains

php_value allow_url_fopen on

However, I still get the error.

Is there something else I have to do? Do I need to move the .htaccess into the same directory as the script?

If this is unachievable, is there a way to modify the script to use curl?

Thanks in advance
~Michael

CFMaBiSmAd
10-21-2007, 02:48 AM
The reason they could not give you instructions on how to do this in a .htaccess file, is because you cannot do it in a .htaccess file for current versions of php. Here is the definition from the php manual -
allow_url_fopen PHP_INI_SYSTEM (PHP_INI_ALL in PHP <= 4.3.4.) PHP_INI_SYSTEM means only in php.ini or httpd.conf. If you happened to be using PHP 4.3.4 or lower, you could set it in a .htaccess file or even in the script using an ini_set() statement. If you can use a local php.ini, you should be able to set it in there. Your web host would be able to tell you if this is the case.

LightScribe
10-21-2007, 03:35 AM
Thank you for that. My host obviously has great tech support because I do have a php.ini file in my root directory, which actually had allow_url_fopen set to off. I've set it to on and it's fine now.

Thanks for pointing me in the right direction, mate.