14

I upload my Laravel project on shared hosting. When I upload my project on the server it throws an exception then switched my PHP version 5.4 to 7.4. Now am facing this issue.

Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0

I also disable the allow_url_include in my PHP ini file which exists in project root directory but it still says allow_url_include depreciated error.

Also, I go into the PHP Multi INI Editor and change the allow_url_include but it still throw the above error.

Hadayat Niazi
  • 1,991
  • 3
  • 16
  • 28

6 Answers6

8

Remove .htaccess or change name to .htaccess.backup and WP will generate new file based on your site configuration

Basem Olimy
  • 767
  • 7
  • 10
6

Log into your website host and navigate to your public_html folder and find the php.ini file. Open the file and find this code:

; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
; http://php.net/allow-url-include
allow_url_include = On

Change allow_url_include = On to allow_url_include = Off and save the file.

This should fix the error.

Additional detail located here: https://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-include

pmcgeehan
  • 61
  • 1
  • 3
5

In case anyone comes across this:

Make sure that .htaccess files at all levels do not have conflicting code.

That is, I found that my ".../public_html/.htaccess" did not have any conflicts. However, I also had an .htaccess file in the folder level above that and it included code that read:

# Use PHP71 as default AddHandler application/x-httpd-php71 .php <IfModule mod_suphp.c> suPHP_ConfigPath /opt/php71/lib </IfModule>

Commenting this out resolved the error for me.

Mic M.
  • 51
  • 1
  • 1
1

If your web host uses Cpanel, log in and under the Software section click Select PHP Version, then on the next screen click Options. Under Options, unclick allow_url_include:

enter image description here

enter image description here

CoderBlue
  • 695
  • 7
  • 14
0

Please Update PHP version of your site through CPanel to 7.3. This fixed the issue for my site. Thank you!

Zahid Iqbal
  • 134
  • 3
  • 10
0

My client had 2 .ini files, conflicting max_input_var.

Deleting user.ini worked for me! Payment options were greyed out in WooCommerce. Now they are showing and this "allow_url" error is gone.

Obsidian
  • 3,719
  • 8
  • 17
  • 30