Enable Allow_url_fopen On Php File

  1. Php Allow Url Include
  2. Php Fopen Url
  3. Enable Allow_url_fopen In Php File
Active2 years, 11 months ago

ok so, Im building a fancy pants wordpress theme and part of the theme has php getting image widths and using those numbers to resize page elements. It works fine on my local machine, but when I put the theme on my hosted server using cpanel, it doesnt work.

I get this error

From the manual. Allow_url_fopen boolean. This option enables the URL-aware fopen wrappers that enable accessing URL object like files. Default wrappers are provided for the access of remote files. The php.ini file is where you declare changes to your PHP settings. You can edit the existing php.ini, or create a new text file in any subdirectory and name it php.ini. You can read more about php.ini by clicking the Related Articles. Enable allow_url_fopen, allow_url_include in php.ini: You can simply manage allow_url_fopen and allow_url_include function by editing php. Allow_url_fopen, how to enable. Allow_url_fopen = On The php.ini file is where you declare changes to your PHP settings. You can edit the existing php.ini,. If you want to enable the allow_url_include and allow_url_fopen function then modify the configuration php file. For enabling this functions follow below steps: Step 1: first you should open or create a php.ini file below public folder. Php_value allow_url_fopen On Create a php.ini file (for update server php5.ini) and keep it in root folder (sometimes it may need to place it one step back folder of the root) and paste the following code there: allow_url_fopen = On; I have personally tested the above solutions; they worked for me.

Allow_url_fopen = On The php.ini file is where you declare changes to your PHP settings. You can edit the existing php.ini, or create a new text file in any subdirectory and name it php.ini.

SO I thought if I made a php.ini file in the wordpress's root directory with this in it:

That would work, but it wont.

Is there anyway to get this to work?

rugbertrugbert
3,5368 gold badges32 silver badges58 bronze badges

6 Answers

Try to add this code to your .htaccess file:

If it does not work, you will need ask your hosting provider about your php.ini file location, if it exists. If it does not, ask them to set this up for you in global php.ini file. Usually it's /etc/php.ini

John SmithJohn Smith

Other plugin developers seem to use cURL to get around allow_url_fopen restrictions. It is probably best for you to find a way to make your theme work without requiring allow_url_fopen to be enabled. Many providers turn this off for security reasons.

Sarah KempSarah Kemp
2,3702 gold badges15 silver badges27 bronze badges

None of these seemed to work on my host, and this is for a wordpress theme so it had to be a fix that could work for everyone so I just used jQuery. Tho if a users has their javascript turned off it wont work but I can live with that.

rugbertrugbert
3,5368 gold badges32 silver badges58 bronze badges

Using cURL will bypass the issue. Some information and details that may be helpful can be found here:

Community
DougDoug
3,2543 gold badges45 silver badges72 bronze badges

If you are on cPanel 11.58+ this is an option within the cPanel.You can do enable this by following these steps: 1. Login to cPanel. 2. Select 'MultiPHP INI Editor' under the 'Software' section 3. Select the domain you want to make this change for from the drop down 4. The first option will be 'allow_url_fopen'.

If you want to make the above change global in WHM you can so do something similar in multiphpini editor.

However, if you are on an older cPanel version you will have to edit your php.ini manually.

jasdhfiu-asef-aesf-asef-a-sgaajasdhfiu-asef-aesf-asef-a-sgaa

Add to php.ini or php5.ini

Works with Joomla 3.1 hope that helps.

pinckerman
3,5735 gold badges27 silver badges39 bronze badges
CrazyCrazy

Not the answer you're looking for? Browse other questions tagged phpwordpresscpanel or ask your own question.

Active5 years, 11 months ago

I want to allow allow_url_fopen on my server . I have asked my host and they said it can be done with a .htaccess file. Can anyone tell me how to go about this ?

borrible
13.9k6 gold badges44 silver badges68 bronze badges
Mick

Php Allow Url Include

Mick
1,3329 gold badges32 silver badges59 bronze badges

closed as off topic by Jens Erat, Toto, pilsetnieks, Pete, EliMay 3 '13 at 8:47

Questions on Stack Overflow are expected to relate to programming within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers

Try this, but I don't think it will work because you're not supposed to be able to change this

Php Fopen Url

Put this line in an htaccess file in the directory you want the setting to be enabled:

Note that this setting will only apply to PHP file's in the same directory as the htaccess file.

As an alternative to using url_fopen, try using curl.

KranuKranu

allow_url_fopen is generally set to On.If it is not On, then you can try two things.

  1. Create an .htaccess file and keep it in root folder ( sometimes it may need to place it one step back folder of the root) and paste this code there.

  2. Create a php.ini file (for update server php5.ini) and keep it in root folder (sometimes it may need to place it one step back folder of the root) and paste the following code there:

I have personally tested the above solutions; they worked for me.

Ry-
176k42 gold badges361 silver badges378 bronze badges
Syed Nurul IslamSyed Nurul Islam

If your host is using suPHP, you can try creating a php.ini file in the same folder as the script and adding:

Nokia 3 top and bottom sides As for the bottom and top bezels, you get a 3.5mm audio jack above the earpiece. Next to it is a secondary noise-canceling mic - a rather uncommon feature in the. Setting Manual Mms Hp Nokia Read/Download To configure your Nokia Lumia 928 to use AT&T Internet and MMS in United States follow below steps. Open cellular United States manual settings. Press the field below 'Connection name' and key in Vodafone MMS +. Gemes perang atur serategi hp nokia x5. Gimana cara instal whatsapp untuk x3-02? Ada yg harus di atur setting hp nya gak? Bisakah instal funmoods untuk android saya? Cara download aplikasi bbm untuk nokia asha 3. Bisakan menggunakan aplikasi bbm di hp nokia x5? Bisakan menggunakan aplikasi bbm pada hp nokia x5, bagaimana caranya Comment. Dec 17, 2017  servis hp nokia 225 blank solution. Cara mengatasi hp nokia 225 yang ngeblank,ganti lcd masih tetep. Jun 24, 2017  ternyata HP NOKIA memiliki kode Rahasia semoga informmasi yang saya bagikan ini berguna bagi pemirsa.

File

allow_url_fopen = On

Enable Allow_url_fopen In Php File

(you can determine this by creating a file and checking which user it was created under: if you, it's suPHP, if 'apache/nobody' or not you, then it's a normal PHP mode. You can also make a script

To give the same information, assuming shell_exec is not a disabled function)

Tim GreenTim Green
1,6811 gold badge14 silver badges19 bronze badges

Not the answer you're looking for? Browse other questions tagged php or ask your own question.