Archived

This forum has been archived. Please start a new discussion on GitHub.

Does IcePHP need register_globals on to function?

I'm getting one error after another. Here's an example: Warning: require_once(Ice/BuiltinSequences.php) [function.require-once]: failed to open stream: No such file or directory in /usr/lib/php/Ice.php on line 119

Fatal error: require_once() [function.require]: Failed opening required 'Ice/BuiltinSequences.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/usr/share/php:/opt/Ice-3.4.2/php/Ice') in /usr/lib/php/Ice.php on line 119

I've been manually copying the required files to the the include folders, but the next in the list will then come up as an error. Ice.php is calling for a number of them, and isn't finding them on its own. Is this due to having register_globals set to off?

This is taken from the beginning of the Ice.php file:

<?php
// **********************************************************************
//
// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

//
// These symbols are defined by the extension but must be declared global
// here to ensure they are visible to scripts regardless of the scope in
// which we are currently executing.
//
global $IcePHP__t_bool;
global $IcePHP__t_byte;
global $IcePHP__t_short;
global $IcePHP__t_int;
global $IcePHP__t_long;
global $IcePHP__t_float;
global $IcePHP__t_double;
global $IcePHP__t_string;

*******************************

And the list of files called later in the script that each will create and error:

// Include certain generated files.
//
require_once 'Ice/BuiltinSequences.php';
require_once 'Ice/Endpoint.php';
require_once 'Ice/EndpointTypes.php';
require_once 'Ice/LocalException.php';
require_once 'Ice/Locator.php';
require_once 'Ice/ObjectFactory.php';
require_once 'Ice/Process.php';
require_once 'Ice/Router.php';

And below is some information you may find helpful:

[root@host ~]# export LD_LIBRARY_PATH=/opt/Ice-3.4.2/lib
[root@host ~]# echo $LD_LIBRARY_PATH
/opt/Ice-3.4.2/lib
[root@host ~]# ldd /usr/local/lib/php/extensions/IcePHP.so
ldd: /usr/local/lib/php/extensions/IcePHP.so: No such file or directory
[root@host ~]# ldd /usr/local/lib/php/extensions/IcePHP.so
libIce.so.34 => /opt/Ice-3.4.2/lib/libIce.so.34 (0xb7aa0000)
libSlice.so.34 => /opt/Ice-3.4.2/lib/libSlice.so.34 (0xb7894000)
libIceUtil.so.34 => /opt/Ice-3.4.2/lib/libIceUtil.so.34 (0xb782c000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb7806000)
librt.so.1 => /lib/librt.so.1 (0xb77fd000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7713000)
libm.so.6 => /lib/libm.so.6 (0xb76ea000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb76de000)
libc.so.6 => /lib/libc.so.6 (0xb7585000)
libbz2.so.1 => /usr/lib/libbz2.so.1 (0xb7574000)
libdl.so.2 => /lib/libdl.so.2 (0xb756f000)
/lib/ld-linux.so.2 (0xb7f54000)
[root@host ~]# find / -name 'BuiltinSequences.php'
/usr/share/php/Ice/BuiltinSequences.php
/root/Ice-3.4.2/php/lib/Ice/BuiltinSequences.php
/opt/Ice-3.4.2/php/Ice/BuiltinSequences.php
[root@host ~]#

[root@host ~]# php -m
[PHP Modules]
APD
bcmath
bz2
calendar
ctype
curl
date
dom
eAccelerator
exif
filter
ftp
gd
gettext
hash
ice
iconv
imap
ionCube Loader
json
libxml
mbstring
mcrypt
mhash
mysql
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
posix
pspell
Reflection
session
SimpleXML
soap
sockets
SPL
SQLite
standard
timezonedb
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend Optimizer
zip
zlib

[Zend Modules]
Advanced PHP Debugger (APD)
Zend Optimizer
the ionCube PHP Loader

[root@host ~]# [root@host ~]# php -m
[PHP Modules]
APD
bcmath
bz2
calendar
ctype
curl
date
dom
eAccelerator
exif
filter
ftp
gd
gettext
hash
ice
iconv
imap
ionCube Loader
json
libxml
mbstring
mcrypt
mhash
mysql
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
posix
pspell
Reflection
session
SimpleXML
soap
sockets
SPL
SQLite
standard
timezonedb
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend Optimizer
zip
zlib

[Zend Modules]
Advanced PHP Debugger (APD)
Zend Optimizer
the ionCube PHP Loader

[root@host ~]# echo $ICE_HOME
(blank)

Thank you in advance for any clarity on this. Please note my php-fu is only a very basic understanding and that it's quite possible (highly likely) that register_globals has little or nothing to do with the coding listed above or with any of my problems. In that event, I'd still be much appreciative of any advice on how to rectify the situation. :)

Comments

  • xdm
    xdm La Coruña, Spain
    Hi Brakkish,

    If you have installed Ice for PHP in /opt you need to add the php sub directory to PHP include_path. That is documented in php/INSTALL file in 'Source Files' section.

    [PHP]
    // PHP
    ini_set('include_path',
    ini_get('include_path') . PATH_SEPARATOR . '/opt/Ice-3.4.2/php');
    require 'Ice.php'; // Load the core Ice run time definitions.
    [/PHP]

    I see that you have /opt/Ice-3.4.2/php/Ice in your include_path, that isn't necessary for Ice unless you want to included files in your project without using 'Ice/' prefix, is better to not add /opt/Ice-3.4.2/php/Ice to avoid file name conflicts, and always include Ice files using 'Ice/' prefix.

    Regards,
    Jose