From:             Severn at dreamfusion dot net
Operating system: Linux
PHP version:      5.0.2
PHP Bug Type:     Scripting Engine problem
Bug description:  include / include_once relative paths on command line

Description:
------------
May be related to bug #29949, #28338, #9673

When using the php cli, relative paths are not relative to the script, but
relative to where the cli was started

Notes:
-No include_path is set in php.ini
-Works as expected in PHP 4.3.8 (cgi)
-Works as expected when PHP is an Apache module

Reproduce code:
---------------
/inc/a.php
<?php include('../b.php'); ?>

/b.php
<?php echo 'boo'; ?>

cd /
php inc/a.php

Expected result:
----------------
boo

Actual result:
--------------
PHP Warning:  main(../b.php): failed to open stream: No such file or
directory in /inc/a.php on line 1
PHP Warning: main(): Failed opening '../b.php' for inclusion
(include_path='.:/usr/lib/php') in /inc/a.php on line 1

-- 
Edit bug report at http://bugs.php.net/?id=30416&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30416&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30416&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30416&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30416&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30416&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30416&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30416&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30416&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30416&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30416&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30416&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30416&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30416&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30416&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30416&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30416&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30416&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30416&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30416&r=mysqlcfg

Reply via email to