php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47265 generating phar.phar failes because of safe_mode
Submitted: 2009-02-01 23:28 UTC Modified: 2009-02-03 18:18 UTC
From: lars at larswolter dot de Assigned: cellog (profile)
Status: Closed Package: PHAR related
PHP Version: 5.3.0beta1 OS: Linux
Private report: No CVE-ID: None
 [2009-02-01 23:28 UTC] lars at larswolter dot de
Description:
------------
Compilation failes while generating phar.phar. This happens if php is configured with safe_mode to on.

Workaround?
Add -d 'safe_mode=0' to PHP_PHARCMD_SETTINGS

Reproduce code:
---------------
'./configure' '--without-mm' \
    '--with-mysql' '--prefix=/usr/lib/php5' \
    '--with-mcrypt' \
    '--enable-safe-mode' \
    '--with-openssl' '--with-zlib' '--enable-calendar' \
    '--enable-exif' '--enable-ftp' \
    '--with-gd' '--with-imap' '--with-kerberos' \
    '--with-imap-ssl' \
    '--enable-gd-native-ttf' \
    '--enable-force-cgi-redirect' \
    '--with-freetype-dir=/usr/include/freetype2' \
    '--with-jpeg-dir=/usr/lib' \
    '--with-gettext' '--with-iconv' '--enable-mbstring=all' \
    '--enable-mbregex' '--with-xsl' '--with-pdo-mysql'

Expected result:
----------------
Build complete.

Actual result:
--------------
Warning: shell_exec(): Cannot execute using backquotes in Safe Mode in /home/lars/php-5.3.0beta1/ext/phar/phar.php on line 706
Pear package PHP_Archive or Archive.php class file not found.

Warning: Phar::__construct(): SAFE MODE Restriction in effect.  The script whose uid is 0 is not allowed to access /home/lars/php-5.3.0beta1/ext/phar owned by uid 1001 in /home/lars/php-5.3.0beta1/ext/phar/phar.php on line 1055

Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Phar creation or opening failed' in /home/lars/php-5.3.0beta1/ext/phar/phar.php:1055
Stack trace:
#0 /home/lars/php-5.3.0beta1/ext/phar/phar.php(1055): Phar->__construct('/home/lars/php-5.3.0...', 0, 'pharcommand')
#1 [internal function]: PharCommand->cli_cmd_run_pack(Array)
#2 /home/lars/php-5.3.0beta1/ext/phar/phar.php(225): call_user_func(Array, Array)
#3 /home/lars/php-5.3.0beta1/ext/phar/phar.php(2078): CLICommand->__construct(19, Array)
#4 {main}
  thrown in /home/lars/php-5.3.0beta1/ext/phar/phar.php on line 1055
make: *** [ext/phar/phar.phar] Fehler 255

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-03 17:12 UTC] cellog@php.net
I'll handle this one
 [2009-02-03 18:18 UTC] cellog@php.net
This bug has been fixed in CVS.

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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 23:01:26 2024 UTC