php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61503 Call to dirname() produces: PHP Fatal error: Call to undefined function (null)
Submitted: 2012-03-25 11:15 UTC Modified: 2012-03-25 13:01 UTC
From: rodush at gmail dot com Assigned:
Status: Not a bug Package: Directory function related
PHP Version: 5.4.0 OS: Debian 6.0; Linux 3.0.0-2-686pae
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rodush at gmail dot com
New email:
PHP Version: OS:

 

 [2012-03-25 11:15 UTC] rodush at gmail dot com
Description:
------------
After upgrading to php5.4 on my Debian (configured to "testing" sources for apt)
none of my local website works.
After upgrade I used option "maintainer's version of php.ini" for all php.ini files (apache, fpm, cli).
Version of Apache: 2.2.22
Here what I see in one of my error log files (Apaches's):
[Sun Mar 25 13:32:54 2012] [error] [client 127.0.0.1] PHP Fatal error:  Call to undefined function (null)() in /home/web/ccc/frontend/index.php on line 4
Actually, this is regular Yii fremework's frontpage. Nothing was changed and worked perfect before upgrade.

Test script:
---------------
     1<?php
       2                                                                                                                                                                            
     3  // change the following paths if necessary                                                                                                                                
     4  $yii=dirname(__FILE__).'/../framework/yii.php';                                                                                                                           
     5  $config=dirname(__FILE__).'/protected/config/main.php';
     6
     7  // remove the following lines when in production mode
     8  defined('YII_DEBUG') or define('YII_DEBUG',true);
     9  // specify how many levels of call stack should be shown in each log message
    10  defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
    11
    12  require_once($yii);
    13  Yii::createWebApplication($config)->run();

Expected result:
----------------
dirname() must be called without error producing and should return full path to the current file.

Actual result:
--------------
PHP Fatal error:  Call to undefined function (null)() in /home/web/ccc/frontend/index.php on line 4

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-25 11:33 UTC] rasmus@php.net
Looks like there is something else at play here that you haven't told us about. 
dirname() obviously works fine in 5.4. Try it from the command line:

php -r 'echo dirname(__FILE__);'

Of course, you should just use __DIR__ to do that, but my guess is that you have 
some other low-level extension like an apc ot xcache that you haven't upgraded to 
work with 5.4 that is causing this weird symbol table corruption.
 [2012-03-25 11:33 UTC] rasmus@php.net
-Status: Open +Status: Feedback
 [2012-03-25 12:53 UTC] rodush at gmail dot com
-Status: Feedback +Status: Open
 [2012-03-25 12:53 UTC] rodush at gmail dot com
Yes, sorry for bad bug reporting.
I found that the issue caused by this:

rodush@rdushko:/var/www$ php test.php 
Failed loading /usr/lib/php5/20090626+lfs/xdebug.so:  /usr/lib/php5/20090626+lfs/xdebug.so: cannot open shared object file: No such file or directory
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/suhosin.so' - /usr/lib/php5/20100525+lfs/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/xhprof.so' - /usr/lib/php5/20100525+lfs/xhprof.so: cannot open shared object file: No such file or directory in Unknown on line 0

When I removed old extension's ini configs (just renamed files) all worked fine, both cli and web based scripts.
Sorry again :)
 [2012-03-25 13:01 UTC] rasmus@php.net
-Status: Open +Status: Not a bug
 [2012-03-25 13:01 UTC] rasmus@php.net
ok
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC