Linux Sysadmin Blog

Enabling Allow_url_include Locally in cPanel

- | Comments

When using cPanel the way to enable allow_url_include directive locally (per user) is to create an Virtual Host include:

First create an include file:

/usr/local/apache/conf/userdata/std/2/username/domain.com/custom.conf

Add directive to custom.conf:

1
php_admin_flag allow_url_include On

Then run to enable include:

/scripts/ensure_vhost_includes --user=username --verbose

Alternatively, enabling allow_url_include globally (server-wide) is done by editing /usr/local/lib/php.ini and adding “allow_url_include = On” directive to the Fopen wrapper section.

1
2
3
;;;;;;;;;;;;;;;;;;                                                                                                                                           
; Fopen wrappers ;                                                                                                                                           
;;;;;;;;;;;;;;;;;;
1
2
3
;Whether to allow the treatment of URLs (like http:// or ftp://) as files.                                                                                  
allow_url_fopen = On
**allow_url_include = On**

and restarting apache by issuing service httpd restart command as root.

Comments