php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #51629 CURLOPT_FOLLOWLOCATION error message is misleading
Submitted: 2010-04-22 07:08 UTC Modified: 2010-04-22 10:58 UTC
From: brad at njoe dot com Assigned: pajoye (profile)
Status: Closed Package: Safe Mode/open_basedir
PHP Version: 5.3.2 OS: N/A
Private report: No CVE-ID: None
 [2010-04-22 07:08 UTC] brad at njoe dot com
Description:
------------
The following error message is semantically wrong (and for the "newbies" that 
aren't familiar with PHP, very misleading/confusing):

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION can not be 
activated when in safe_mode or an open_basedir is set in <file> on line <line>

From a purely grammatical standpoint, that error message is saying that one of 
the following conditions caused the error: either you're in safe_mode, or an 
open_basedir option was set in <file>. The "in <file> on line <line>" that 
directly follows the open_basedir bit makes it sound like one should look for 
something dealing with "open_basedir" in <file> in order to resolve the error 
(assuming they aren't in safe mode).

This situation actually happened on a PHP support community I'm a member of. I 
only mention this to show that I'm not simply quibbling over semantics/grammar 
but rather trying to clarify a misleading error message.

Test script:
---------------
<?php
ini_set('open_basedir', '/'); // for testing purposes

$ch = curl_init();
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

Expected result:
----------------
No output.

Actual result:
--------------
PHP Warning:  curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when in 
safe_mode or an open_basedir is set in G:\php\test.php on line 6

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-22 10:58 UTC] pajoye@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=298299
Log: - Bug #51629, CURLOPT_FOLLOWLOCATION error message is misleading
 [2010-04-22 10:58 UTC] pajoye@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: pajoye
 [2010-04-22 10:58 UTC] pajoye@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2010-04-22 13:49 UTC] pajoye@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=298313
Log: - Bug #51629, CURLOPT_FOLLOWLOCATION error message is misleading
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC