PHP 5 Unable to Open HTTP Request Stream with fopen or fsockopen Functions PHP 5 Impossible d'ouvrir HTTP Request Stream avec fopen ou fsockopen Fonctions
With Apache/2.xx or Apache/2.2.x webserver, with PHP5 as the scripting module, a HTTP communication error may occur within the PHP scripts that are parsing and running via the web server. Avec Apache/2.xx ou Apache/2.2.x web, avec PHP5 que le module de script, une erreur de communication HTTP mai se produire dans les scripts PHP qui sont en cours d'exécution et de parsing via le serveur Web.
The errors that generated by PHP include: Les erreurs générées par PHP suivants:
PHP Warning: fopen(http://www.example.com): failed to open stream: HTTP request failed! PHP Warning: fopen (http://www.example.com): failed to open stream: HTTP request failed!
fsockopen(): unable to connect to … fsockopen (): Impossible de se connecter à ...
file_get_contents(): failed to open stream: HTTP request failed! file_get_contents (): failed to open stream: HTTP request failed!
PHP Warning: main(): Failed opening ‘http://www.example.com/index.html’ for inclusion … PHP Warning: main (): Failed opening 'http://www.example.com/index.html pour ce ...
PHP Warning: include(/usr/local/index.php): failed to open stream: No such file or directory in … PHP Warning: include (/ usr / local / index.php): failed to open stream: Aucun fichier ou répertoire dans ...
To resolve the problem, ensure that allow_url_fopen is enabled in PHP.INI configuration file. Pour résoudre le problème, faire en sorte que allow_url_fopen est activé dans le fichier de configuration php.ini. The line should look like this: La ligne devrait ressembler à ceci:
allow_url_fopen = On allow_url_fopen = On
Note: Depending on your system OS and configuration, the PHP.INI is located at various varied location, such as in Apache bin directory for Windows system or /usr/local/etc in FreeBSD Apache installation, if you don’t specify or point to PHP.INI in another directory. Note: Selon votre système OS et de configuration, le fichier php.ini se trouve à divers emplacement variés, tels que Apache dans le répertoire bin pour les système Windows ou / usr / local / etc dans FreeBSD installation d'Apache, si vous ne spécifiez pas ou point à votre php.ini dans un autre répertoire.
If the error still happen and the PHP scripts still unable to connect to remote external servers and thus unable to download updates or retrieve files, check the user_agent setting in PHP.ini. Si l'erreur se produire et les scripts PHP ne parvenez toujours pas à se connecter à distance à des serveurs externes, et donc pas en mesure de télécharger des mises à jour ou de récupérer des fichiers, vérifier la mise en user_agent dans le fichier php.ini.
By default php.ini set the user_agent to “PHP” which signifies that it’s the script that try to access the web server. Par défaut le fichier php.ini l'ensemble user_agent à "PHP" qui signifie que c'est le script qui tentent d'accéder au serveur Web. Some web servers will refuse and don’t allow script to access and receive the date from the server. Certains serveurs Web refusent et ne permettent pas de script d'accès et de recevoir la date à partir du serveur. So, by setting the user_agent to that of a web browser, PHP will let the web server know which kind of web browser will receive the date, and thus able to open the HTTP connection stream. Ainsi, par la mise en user_agent à celui d'un navigateur web, PHP va laisser le serveur Web de savoir quel type de navigateur web sera la date, et donc capables d'ouvrir la connexion HTTP flux.
The user_agent can be set to any kind of browser strings, for example of Internet Explorer: Le user_agent peut être réglé à tout type de navigateur cordes, par exemple d'Internet Explorer:
user_agent=”Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)” user_agent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANT: Il s'agit d'une machine qui traduit la page est fourni "tel quel" sans garantie. Machine translation may be difficult to understand. La traduction automatique mai être difficile à comprendre. Please refer to S'il vous plaît se référer à original English article article original en anglais whenever possible. chaque fois que possible.
Share and contribute or get technical support and help at Partager et de contribuer ou obtenir un appui technique et aider à My Digital Life Forums Ma vie numérique forums .
Related Articles Related Articles
- Making phpBB2 working with PHP5 Faire phpBB2 travailler avec PHP5
- PHP Parse Error: syntax error, unexpected $end PHP Parse Error: syntax error, unexpected $ end
- gmmktime Error in WordPress and MagpieRSS gmmktime Erreur dans WordPress et MagpieRSS
- Proper Way to Generate MD5 Hash for XCache Administration Password with md5sum or PHP Une bonne manière de générer hachage MD5 pour XCache mot de passe d'administration avec md5sum ou PHP
- PHP Scripts open_basedir Restriction in Effect Error Scripts PHP open_basedir restriction en effet erreur
- Aerielle Launches New i2i Stream Wireless Music-Sharing Device AERIELLE lance une nouvelle initiative i2i Stream musique sans fil de partage de périphériques
- Meaning of TVAnts Buffer Progress Bar Colors Sens de l'TVAnts tampon barre de progression couleurs
- Unable to Delete Photo Folders Impossible de supprimer des dossiers photo
- Using PHP-MySQL Persistent Connections to Run WordPress Blog Utiliser PHP-MySQL les connexions persistantes à courir WordPress Blog
- Comments and Comment Blocks in PHP Commentaires et Commentaire Blocs en PHP
































