Hide Forgot
Created attachment 1206308 [details] .tar.xz file containing three files used to reproduce the issue Description of problem: Trying to use LOAD DATA LOCAL INFILE fails when PHP's open_basedir setting is non-empty. More details in this PHP bug: https://bugs.php.net/bug.php?id=62889 Version-Release number of selected component (if applicable): php54-2.0-1.el6.x86_64 mysql-server-5.1.73-7.el6.x86_64 php54-php-mysqlnd-5.4.40-4.el6.x86_64 How reproducible: Always Steps to Reproduce: 1. Setup mysql and install php with mysqlnd drivers 2. Create a table in the "test" database using the attached create-rhel-tables.sql 3. Set open_basedir in /opt/rh/php54/root/etc/php.ini 4. Edit the attached sample.php to look at the open_basedir value set in step #3 5. Run the attached sample.php with `php sample.php` Actual results: The query fails with error 1148 "The used command is not allowed with this MySQL version" Expected results: The query is executed and runs as expected, affecting 3 rows. Additional info: Using the LOAD DATA LOCAL INFILE from the mysql command line tool works. This also works if the open_basedir setting in PHP is disabled. The second comment of the linked PHP bug lists a workaround that doesn't work. According to PHP's documentation on PDO::MYSQL_ATTR_READ_DEFAULT_GROUP [1], this option is not read when using mysqlnd. [1] http://php.net/manual/en/ref.pdo-mysql.php
I can reproduce with 5.4 and 5.5 $ scl enable php54 bash $ php sample.php Query run successfully. 2 rows affected $ php -d open_basedir=/home sample.php Query failed: ERRNO=(1148) The used command is not allowed with this MySQL version $ php -d open_basedir=/tmp sample.php Query failed: ERRNO=(1148) The used command is not allowed with this MySQL version $ scl enable php55 bash $ php sample.php Query run successfully. 2 rows affected $ php -d open_basedir=/home sample.php Query failed: ERRNO=(1148) The used command is not allowed with this MySQL version $ php -d open_basedir=/tmp sample.php Query failed: ERRNO=(1148) The used command is not allowed with this MySQL version Newer versions work as expected $ scl enable rh-php56 bash $ php sample.php Query run successfully. 2 rows affected $ php -d open_basedir=/home sample.php Query run successfully. 2 rows affected $ php -d open_basedir=/tmp sample.php Query failed: ERRNO=(2000) open_basedir restriction in effect. Unable to open file $ scl enable rh-php70 bash $ php sample.php Query run successfully. 2 rows affected $ php -d open_basedir=/home sample.php Query run successfully. 2 rows affected $ php -d open_basedir=/tmp sample.php Query failed: ERRNO=(2000) open_basedir restriction in effect. Unable to open file
Looks like this is related to 68077, only fixed in 5.6+ http://git.php.net/?p=php-src.git;a=commit;h=be6fd4ba89e151b68ddd68e53d6a403c2e8eb862 http://git.php.net/?p=php-src.git;a=commit;h=fba3985f23020d53ce370e3c4ac685646bda5c92
Red Hat Enterprise Linux 6 transitioned to the Production 3 Phase on May 10, 2017. During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available. The official life cycle policy can be reviewed here: http://redhat.com/rhel/lifecycle This issue does not appear to meet the inclusion criteria for the Production Phase 3 and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification. Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL: https://access.redhat.com