Bug #68226 [NEW]: FULLY UNABLE TO USE LOAD DATA LOCAL Startement IN Web Production Enviroments
| From: | georgy dot garnov at gmail dot com | Date: | Tue, 14 Oct 2014 10:57:16 +0000 |
| Subject: | Bug #68226 [NEW]: FULLY UNABLE TO USE LOAD DATA LOCAL Startement IN Web Production Enviroments | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-188083@lists.php.net to get a copy of this message | ||
From: georgy dot garnov at gmail dot com
Operating system: ALL
PHP version: 5.6.1
Package: PDO MySQL
Bug Type: Bug
Bug description:FULLY UNABLE TO USE LOAD DATA LOCAL Startement IN Web Production Enviroments
Description:
------------
If you set open_basedir in your php.ini or use php as fcgi you will
always got "The used command is not allowed with this MySQL version"
error.
You can use new PDO($dsn,$login,$password,
array(PDO::MYSQL_ATTR_LOCAL_INFILE => true)) but you will have no
effect.
So you are fully unable to use LOAD DATA LOCAL INFILE.
That's because of \ext\pdo_mysql\mysql_driver.c
LINES 626 to 633
#if PHP_API_VERSION < 20100412
if ((PG(open_basedir) && PG(open_basedir)[0] != '\0') ||
PG(safe_mode))
#else
if (PG(open_basedir) && PG(open_basedir)[0] != '\0')
#endif
{
local_infile = 0;
}
as you can see, you will always fail in production enviroments
no check if loaded file inside base dir just fail.
That's bad!!
--
Edit bug report at https://bugs.php.net/bug.php?id=68226&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68226&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68226&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68226&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68226&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68226&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68226&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68226&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68226&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68226&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68226&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68226&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68226&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68226&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68226&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68226&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68226&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68226&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68226&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68226&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68226&r=mysqlcfg