views:

31

answers:

1

Hi,

I've upgraded PHP on my local dev system to version 5.3.0, and there is some problem when I use constants in application.ini - following manual http://framework.zend.com/manual/en/learning.quickstart.create-project.html I have:

bootstrap.path = APPLICATION_PATH "/Bootstrap.php"

which leads to:

Warning: require_once(APPLICATION_PATH/Bootstrap.php) [function.require-once]: failed to open stream: No such file or directory in Zend\Application.php on line 320

any ideas?


SOLVED:

Actually name of my constant was _DIR_APPLICATION (code above was copied from ZF manual) - problem lies in this underscore at the begining - it seems that parse_ini_file() in PHP 5.3.0 doesn't replace constants named like this.

Short test - you need two files:

test.ini

bootstrap.path = _DIR_APPLICATION "/Bootstrap.php"
bootstrap.class = "Bootstrap"

and test.php

<?php

define('_DIR_APPLICATION', 'test');

$data = parse_ini_file('test.ini');
print_r($data);

try to run, then change constant name to 'DIR_APPLICATION' (in both files) and compare result ;)

A: 

Your problem is probably related to a change to 'open_basedir' in php 5.3.0

cf. http://www.php.net/manual/fr/ini.core.php#ini.include-path

the open_basedir value may be set in your httpd.conf, in the php.ini or at runtime with ini_set(). I'd recommand to take a look at this value with phpinfo(), comparing between the 2 versions of PHP you're using.

Rodolphe
in both versions: open_basedir => no value
Marek