Roundcube Community Forum

Release Support => Pending Issues => Topic started by: echz on May 21, 2015, 09:59:38 AM

Title: Error trying to launch installer, undefined function in bootstrap.php
Post by: echz on May 21, 2015, 09:59:38 AM
Hello all.  I have had several successful installations of Roundcube and love it!  However, I am attempting to figure out what's going on with an installation that I recently upgraded via FreeBSD ports to 1.1.1,1. 

I'm running Apache 2.4 and PHP 5.6.8 on FREEBSD 10.1-p9.  When attempting to go to the installer via http://www.server.com/roundcube/installer/, I am presented with the message: Fatal error: Call to undefined function filter_var() in /usr/local/www/roundcube/program/lib/Roundcube/bootstrap.php on line 46.  I know the filter extension is installed, and this installation was previously working so I'm unsure what could be the cause...

When going to the roundcube base page, I'm just getting a blank white screen with no content at all. 

At first glance, anything else that uses PHP on the system seems to be working correctly, so I'm not sure what could be going on ... If anyone can offer any insight or things to test, that would be awesome as I'd much rather check my email on the roundcube interface instead of via my phone!  THANKS!!
Title: Re: Error trying to launch installer, undefined function in bootstrap.php
Post by: alec on May 21, 2015, 11:52:52 AM
There are other peaple with filter extension issue on FreeBSD. Google for "freebsd filter_var php".
Title: Re: Error trying to launch installer, undefined function in bootstrap.php
Post by: kewldaemon on July 30, 2015, 09:38:42 AM
Hi folks,

I'm running into the same issue as echz. "Fatal error: Call to undefined function filter_var() in /usr/local/www/roundcube/program/lib/Roundcube/bootstrap.php on line 46"

So far I have been unable to find any useful information from googling "freebsd filter_var php".

FreeBSD 10.0-RELEASE-p18
PHP 5.6.11 (cli) (built: Jul 29 2015 16:23:55)
# php -m | grep -i filter
filter

Roundcube version 1.1.1,1 was working fine until I upgraded to 1.1.1,2
Title: Re: Error trying to launch installer, undefined function in bootstrap.php
Post by: JohnDoh on July 30, 2015, 11:04:53 AM
filter_var exists in PHP >= 5.2.0.

I see in the info you posted it says "PHP 5.6.11 (cli)" but you need to check what version of PHP the webserver is using or (if you webserver runs multiple versions of PHP) what version of PHP the server is configured to run for the roundcube website.

An easy way would be to put a phpinfo() file into the roundcube root and then check what it reports.
Title: Re: Error trying to launch installer, undefined function in bootstrap.php
Post by: kewldaemon on July 30, 2015, 11:52:47 AM
Thanks JohnDoh.

https://www.myserver.com/roundcube/info.php

SERVER_SOFTWARE  Apache/2.4.16 (FreeBSD) OpenSSL/1.0.1l-freebsd PHP/5.6.11 

Please let me know if there is anything else I can provide that may help resolve this.

Thanks.
Title: Re: Error trying to launch installer, undefined function in bootstrap.php
Post by: SKaero on July 30, 2015, 12:57:47 PM
https://gist.github.com/maciakl/5320119
Title: Re: Error trying to launch installer, undefined function in bootstrap.php
Post by: kewldaemon on July 30, 2015, 01:21:09 PM
Thanks SKaero, but I have the filter extension installed. From my initial post:

# php -m | grep -i filter
filter

Also
# pkg info php5\* |grep filter
php56-filter-5.6.11

I even tried reinstalling it.
Title: Re: Error trying to launch installer, undefined function in bootstrap.php
Post by: SKaero on July 30, 2015, 01:35:10 PM
Hmm, http://php.net/manual/en/filter.installation.php says that the PECL extension is no loner updated maybe its broken with php 5.6.x. You may need to build PHP from source in order to get it to work.
Title: Re: Error trying to launch installer, undefined function in bootstrap.php
Post by: kewldaemon on July 30, 2015, 02:19:01 PM
Thanks SKaero. They used PECL prior to PHP 5.2.0. At version 5.2.0 was when they started using the filter extension.

Like I said, Roundcube version 1.1.1,1 was working fine with PHP-5.4.43 and php5-filter-5.4.43.  It wasn't until I upgraded Roundcube to 1.1.1,2. a week or so ago, that it broke. Yesterday I upgraded to PHP 5.6.11 in hopes that would fix the issue. It's almost like the code changed in the bootstap.php file, but then everyone would be having an issue and not just me and one other person. Maybe another FreeBSD user can help shed some light on this.

I'm also open to any other ideas or suggestions.

Thanks,
Title: Re: Error trying to launch installer, undefined function in bootstrap.php
Post by: SKaero on July 30, 2015, 02:38:06 PM
This: https://github.com/roundcube/roundcubemail/commit/fdcef5ef7e20db4241ea6977a1dff15d65464660 was the only code change to bootstrap.php between 1.1.1 and 1.1.2 and that should have caused any problems. If you create a php file in the Roundcube directory with the following code was does it output?
Code: [Select]
<?php
filter_var
('true'FILTER_VALIDATE_BOOLEAN);
Title: Re: Error trying to launch installer, undefined function in bootstrap.php
Post by: kewldaemon on July 30, 2015, 02:54:37 PM
http://www.myserver.com/roundcube/testbootstrap.php gets "The website cannot display the page  HTTP 500".

The http-error.log has the following:

PHP Fatal error:  Call to undefined function filter_var() in /usr/local/www/roundcube/testbootstrap.php on line 2
Title: Re: Error trying to launch installer, undefined function in bootstrap.php
Post by: SKaero on July 30, 2015, 03:45:07 PM
So that means its not in anyway a Roundcube problem so the FreeBSD forum maybe able to help better. Just to confirm you did also check the the filter extension is being loaded in the php config right?
Title: Re: Error trying to launch installer, undefined function in bootstrap.php
Post by: kewldaemon on July 30, 2015, 03:57:27 PM
It appears to be loaded, yes.

# cat /usr/local/etc/php/extensions.ini |grep filter
extension=filter.so

Let me reiterate, Roundcube version 1.1.1,1 was working fine with PHP-5.4.43 and php5-filter-5.4.43.  It wasn't until I upgraded Roundcube to 1.1.2,1 . a week or so ago, that it broke. I too believe that something maybe going on with PHP, it just seems a bit odd that I didn't have any problems until I upgraded Roundcube.

Is there anything else you can think of that I could check?

Thanks.
Title: Re: Error trying to launch installer, undefined function in bootstrap.php
Post by: SKaero on July 31, 2015, 12:38:24 AM
Does restoring a backup of Roundcube 1.1.1 make the problem go away?
Title: Re: Error trying to launch installer, undefined function in bootstrap.php
Post by: kewldaemon on July 31, 2015, 08:21:48 AM
I'd have to build it from scratch. I used FreeBSD ports to upgrade it. I'll try it and let you know.

Thanks
Title: Re: Error trying to launch installer, undefined function in bootstrap.php
Post by: kewldaemon on July 31, 2015, 11:37:00 AM
Okay, so I finally got it working.

1. Completely uninstalled PHP 5.6.11 (during this process, Roundcube was uninstalled as well) because I was going to go back to PHP 5.4.43.
2. During the install of PHP 5.4, I discovered that Roundcube "actually' requires PHP 5.6.11.
3. Uninstalled PHP 5.4.43
4. Instead of installing PHP and the extensions from their perspective individual ports, I used the FreeBSD 'pkg install' (using the below commands [for the FreeBSD people])
# pkg install php56 php56-extensions mod_php56
...
New packages to be INSTALLED:
        php56: 5.6.11
        php56-extensions: 1.0
        mod_php56: 5.6.11
        php56-session: 5.6.11
        php56-opcache: 5.6.11
        php56-xmlwriter: 5.6.11
        php56-xmlreader: 5.6.11
        php56-dom: 5.6.11
        php56-xml: 5.6.11
        php56-simplexml: 5.6.11
        php56-ctype: 5.6.11
        php56-posix: 5.6.11
        php56-hash: 5.6.11
        php56-filter: 5.6.11
        php56-tokenizer: 5.6.11
        php56-json: 5.6.11
        php56-sqlite3: 5.6.11
        php56-pdo_sqlite: 5.6.11
        php56-pdo: 5.6.11
        php56-iconv: 5.6.11
        php56-phar: 5.6.11
...
# pkg install roundcube
...
New packages to be INSTALLED:
        roundcube: 1.1.2,1
        pecl-intl: 3.0.0_2
        php56-pdo_mysql: 5.6.11
        php56-mysql: 5.6.11
        php56-mbstring: 5.6.11
        php56-zip: 5.6.11
...
# pkg install php56-fileinfo php56-openssl php56-mcrypt php56-exif php56-gd php56-curl
...
New packages to be INSTALLED:
        php56-fileinfo: 5.6.11
        php56-openssl: 5.6.11
        php56-mcrypt: 5.6.11
        php56-exif: 5.6.11
        php56-gd: 5.6.11
        php56-curl: 5.6.11
...

Some of the information I gleaned from Kliment Andreev @ http://blog.iandreev.com/?p=1339 and http://blog.iandreev.com/?p=1309 when I did my original install, so I wanted to throw some credit his way.

SKaero, thanks for your patience and time, and all of your help. I really appreciate it.

Title: Re: Error trying to launch installer, undefined function in bootstrap.php
Post by: orie on April 26, 2016, 03:58:54 PM
After struggling with this for a while, I finally found the issue for those of us still building packages locally.  In a nut shell, php5x was compiled with ZTS enabled, while mod_php5x was compiled with ZTS disabled, resulting in a module mismatch.  If the reverse is true, this same symptom may occur.  The solution, cd into the port, /usr/ports/lang/php5x and run make config, enable or disable ZTS.  Then cd into /usr/ports/www/mod_php5x and run make config again, with the same ZTS enabled or disabled as it was in php5x.  Then rebuild the ports with whatever method you'd prefer, such as portmaster.  I actually optioned to just make absolutely sure everything was as I wanted, thusly:

portmaster -dr --force-config php56-5.6.20

Hope this helps someone.