Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php include to external url

Tags:

include

php

I am currently trying to use the php function 'include' to include an external url. This is so that whenever the webpage is updated it will automatically update mine. The trouble I'm having however is that I keep getting an error saying the following...

Warning: require() [function.require]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in C:\wamp\www\starterpack\starterpack2\header.php on line 48

I have tried to find a way to fix this error or find a way around it but cannot find one. Does anyone have any ideas?

P.S I am building the site using wampserver, could permissions of the wampserver be causing this error?

like image 480
Phil Avatar asked Nov 30 '22 03:11

Phil


2 Answers

You would be better using echo file_get_contents($url) as the include statement could execute any PHP code returned by the other site.

like image 100
diolemo Avatar answered Dec 11 '22 11:12

diolemo


Look at your php.ini and make sure allow_url_include is set to 1. Restart HTTPD, done.

like image 38
Barry Chapman Avatar answered Dec 11 '22 10:12

Barry Chapman