Edit report at http://bugs.php.net/bug.php?id=51629&edit=1

 ID:               51629
 Updated by:       paj...@php.net
 Reported by:      brad at njoe dot com
 Summary:          CURLOPT_FOLLOWLOCATION error message is misleading
-Status:           Open
+Status:           Closed
 Type:             Feature/Change Request
 Package:          Safe Mode/open_basedir
 Operating System: N/A
 PHP Version:      5.3.2
-Assigned To:      
+Assigned To:      pajoye

 New Comment:

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.




Previous Comments:
------------------------------------------------------------------------
[2010-04-22 10:58:09] paj...@php.net

Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=298299
Log: - Bug #51629, CURLOPT_FOLLOWLOCATION error message is misleading

------------------------------------------------------------------------
[2010-04-22 07:08:07] 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


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51629&edit=1

Reply via email to