Solved [Solved] PHP Fatal error:Call to undefined function

After recent ports upgrade I get these errors when I try to reach my web services

Code:
[Fri Mar 28 15:29:53.976969 2014] [:error] [pid 22112] [client IP:Port] PHP Fatal error:  Call to undefined function OC\\Session\\session_name() in /usr/local/www/owncloud/lib/private/session/internal.php on line 20
[Fri Mar 28 15:29:53.977444 2014] [:error] [pid 22112] [client IP:Port] PHP Fatal error:  Call to undefined function json_encode() in /usr/local/www/owncloud/lib/private/log/owncloud.php on line 73

guess it is something related to

20140327:
AFFECTS: users of lang/php5 and lang/php55 with Apache module
AUTHOR: ale@FreeBSD.org

The Apache PHP module has been splitted from main PHP port, so if you
are using it you should install one of www/mod_php5 or www/mod_php55.

any hint to solve this issue?

FreeBSD is 10.0-RELEASE #0 r261707
 
Re: PHP Fatal error: Call to undefined function

doll1 said:
After recent ports upgrade I get these errors when I try to reach my web services

Code:
[Fri Mar 28 15:29:53.976969 2014] [:error] [pid 22112] [client IP:Port] PHP Fatal error:  Call to undefined function OC\\Session\\session_name() in /usr/local/www/owncloud/lib/private/session/internal.php
[Fri Mar 28 15:29:53.977444 2014] [:error] [pid 22112] [client IP:Port] PHP Fatal error:  Call to undefined function json_encode() in /usr/local/www/owncloud/lib/private/log/owncloud.php
Please be more explicit. Exactly which ports did you upgrade?

The session-name() error seems odd if your web services were previously working. Do you have www/php5-session or www/php55-session installed? Maybe it needs to be re-installed?

The json_encode() error suggests you don't have JSON support enabled in the php.conf or php.ini file. I can't remember which one off-hand. You have to uncomment the 'extensions=json.so' line to get JSON support.
 
Re: PHP Fatal error: Call to undefined function

trh411 said:
Please be more explicit. Exactly which ports did you upgrade?
Code:
[root@ws:~] # cat /var/tmp/portupgrade.results
+ converters/libiconv (libiconv-1.14_2 -> libiconv-1.14_3)
+ ports-mgmt/pkg (pkg-1.2.6 -> pkg-1.2.7)
+ net/openldap24-client (openldap-client-2.4.38 -> openldap-client-2.4.39)
+ devel/apr1 (apr-1.4.8.1.5.3 -> apr-1.5.0.1.5.3)
+ ports-mgmt/portmaster (portmaster-3.17.3 -> portmaster-3.17.4)
+ devel/pkgconf (pkgconf-0.9.4 -> pkgconf-0.9.5)
+ databases/sqlite3 (sqlite3-3.8.3.1 -> sqlite3-3.8.4.1)
+ lang/perl5.16 (perl5-5.16.3_7 -> perl5-5.16.3_8)
+ devel/p5-Locale-gettext (p5-Locale-gettext-1.05_3 -> p5-Locale-gettext-1.05_3)
+ misc/help2man (help2man-1.43.3_1 -> help2man-1.43.3_1)
+ databases/mysql56-server (mysql56-server-5.6.16 -> mysql56-server-5.6.16)
+ textproc/texi2html (texi2html-5.0_1,1 -> texi2html-5.0_1,1)
+ security/ca_root_nss (ca_root_nss-3.15.4 -> ca_root_nss-3.15.5)
+ devel/autoconf (autoconf-2.69 -> autoconf-2.69)
+ www/apache24 (apache24-2.4.6_1 -> apache24-2.4.9)
+ lang/php55 (php55-5.5.10 -> php55-5.5.10)
+ databases/php55-sqlite3 (php55-sqlite3-5.5.10 -> php55-sqlite3-5.5.10)
+ databases/php55-pdo_sqlite (php55-pdo_sqlite-5.5.10 -> php55-pdo_sqlite-5.5.10)
+ net/php55-ldap (php55-ldap-5.5.10 -> php55-ldap-5.5.10)
+ converters/php55-iconv (php55-iconv-5.5.10 -> php55-iconv-5.5.10)
+ lang/ruby19 (ruby-1.9.3.484_1,1 -> ruby-1.9.3.484_2,1)
+ databases/ruby-bdb (ruby19-bdb5-0.6.6_3 -> ruby19-bdb5-0.6.6_3)
+ ports-mgmt/portupgrade (portupgrade-2.4.12,2 -> portupgrade-2.4.12,2)
+ devel/automake (automake-1.14 -> automake-1.14)
trh411 said:
The session-name() error seems odd if your web services were previously working. Do you have www/php5-session or www/php55-session installed? Maybe it needs to be re-installed?
did a deinstall and another install, same sequence of errors :(
trh411 said:
The json_encode() error suggests you don't have JSON support enabled in the php.conf or php.ini file. I can't remember which one off-hand. You have to uncomment the 'extensions=json.so' line to get JSON support.
json support was enabled before in /usr/local/etc/php.ini and befor the upgrade everything worked flawless. Therefore I thought it had something to do with the separation of www/mod_php55. Clueless :\
 
Re: PHP Fatal error: Call to undefined function

Sorry, forgot to mention that. Yes, I did.
 
Re: PHP Fatal error: Call to undefined function

I just noticed that an update was committed for the /usr/ports/www/mod_php5/Makefile and /usr/ports/www/mod_php55/Makefile today. Maybe if you update your local ports tree and re-install it might help if you have not done that today already?
 
Re: PHP Fatal error: Call to undefined function

trh411 said:
I just noticed that an update was committed for the /usr/ports/www/mod_php5/Makefile and /usr/ports/www/mod_php55/Makefile today. Maybe if you update your local ports tree and re-install it might help if you have not done that today already?
Did it again, didn't help. Now thinkin about if it's possible to roll back just that php upgrade just to the state before the split. :\
 
Re: PHP Fatal error: Call to undefined function

Same issues here, trying to figure out what happened too, it seems to me that this is not about any specific php function, I got "Call to undefined function" with other php programs, calling varied and different functions.
 
Re: PHP Fatal error: Call to undefined function

Behaviour didn't change, even after
portsclean -CDDLPP
portupgrade -rRkfa

but, somehow I realized, while phpinfo() states:
Loaded Configuration File | /usr/local/etc/php.ini
Additional .ini files parsed | /usr/local/etc/php/extensions.ini
there are no loaded extensions. :\

To say it again, before the upgrade everything worked flawlessly and I didn't change the configs on php.

Clueless again. :x
 
Re: PHP Fatal error:Call to undefined function - lost extens

Just for completeness
my php/extensions.ini
Code:
extension=bcmath.so
extension=ffmpeg.so
extension=calendar.so
extension=dom.so
extension=dba.so
extension=simplexml.so
zend_extension=/usr/local/lib/php/20121212-zts/opcache.so
extension=ctype.so
extension=xmlwriter.so
extension=fileinfo.so
extension=posix.so
extension=openssl.so
extension=mcrypt.so
extension=hash.so
extension=xmlreader.so
extension=xml.so
extension=ldap.so
extension=gd.so
extension=ftp.so
extension=exif.so
extension=tokenizer.so
extension=curl.so
extension=sqlite3.so
extension=json.so
extension=mysqli.so
extension=phar.so
extension=pdo.so
extension=filter.so
extension=pdo_sqlite.so
extension=gettext.so
extension=gmp.so
extension=xsl.so
extension=mysql.so
extension=mbstring.so
extension=pdo_odbc.so
extension=iconv.so
extension=imap.so
extension=zlib.so
extension=pcntl.so
extension=zip.so
extension=shmop.so
extension=bz2.so
extension=sockets.so
extension=sysvmsg.so
extension=pdf.so
extension=sysvsem.so
extension=xmlrpc.so
extension=session.so
extension=soap.so
extension=sysvshm.so
extension=pdo_mysql.so
extension=wddx.so
 
Re: PHP Fatal error: Call to undefined function

doll1 said:
but, somehow I realized, while phpinfo() states:
Loaded Configuration File | /usr/local/etc/php.ini
Additional .ini files parsed | /usr/local/etc/php/extensions.ini
there are no loaded extensions. :\
... listed in phpinfo()-output.

Further investigation gives - they are listed in output of php -i

still clueless ;)
 
Re: PHP Fatal error:Call to undefined function - lost extens

Have you enabled all PHP errors (including display_startup_errors)? Nothing in Apache error log?

Can you compare phpinfo outputs between CLI and Apache module (same value for Thread Safety?). Same options for lang/php55 and www/mod_php55?

EDIT : Apache built with MPM-Prefork option (default for 2.2 like 2.4) = PHP does not need Thread Safety.
 
Re: PHP Fatal error:Call to undefined function - lost extens

julp said:
Have you enabled all PHP errors (including display_startup_errors)? Nothing in Apache error log?

Can you compare phpinfo outputs between CLI and Apache module (same value for Thread Safety?). Same options for lang/php55 and www/mod_php55?

Only few hours too late, but YES! These were the questions leading to success. Missing ZTS option in www/mod_php55 made it incompatible with the extensions. So lang/php55 loaded them, while www/mod_php55 didn't.

Thank you, everybody here on thread, and specially the guy running http://www.rootservice.org (german site), who had the right ideas before you.
 
Back
Top