Currently Viewing Posts Tagged php7.0

The simple way to install the dbase extension on php7.0

Here is the simple way to install the dbase extension. One command only.

 

sudo pecl install dbase-7.0.0beta1

It will install the extension for you. You just need to restart php7.0-fpm service.

Check the php information.

If your php is version 5 to 5.7. Change the command to

sudo pecl install dbase

Go to php.net and look at the introduction of dBase section.

This extension has been moved to the PECL repository and is no longer bundled with PHP as of PHP 5.3.0.

That’s why we have to install this extension from pecl installation.

https://pecl.php.net/package/dbase

https://php.net/manual/en/intro.dbase.php

Install dbase extension on php7, Ubuntu 16.04

I followed the instruction mostly based on mote0230 github.

Please be noticed that updating (and probably inserting) with arrays that contain named indexes, is not working. For my project, it is OK. I just need to read the data from dbf files.

dbase-pecl-php7

# PHP 7
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.0-fpm php7.0-curl php7.0-mysql php7.0-dev 

Compile

# dbase for PHP 7
git clone git://github.com/mote0230/dbase-pecl-php7.git ~/php7-dbase
cd php7-dbase/
phpize
./configure
make
sudo make install
cd ~
rm -rf ~/php7-dbase

Continue reading “Install dbase extension on php7, Ubuntu 16.04”

Fix the error: Parameter 1 to W3_Plugin_TotalCache::ob_callback() expected to be a reference,

I checked my Nginx log files and saw a lot of errors as below:

*11047 FastCGI sent in stderr: “PHP message: PHP Warning: Parameter 1 to W3_Plugin_TotalCache::ob_callback() expected to be a reference, value given in /home/users/yinfor.com/wp-includes/functions.php on line 3597” while reading response header from upstream,

I googled it and found the answer.

The reason why it happened is PHP 7 and W3 Total Cache.

Since I can not change PHP 7, I have to change something in W3 Total Cache plugin.

  1.  Find the file /wp-content/plugins/w3-total-cache/lib/W3/Plugin/TotalCache.php
  2.  Go to line 512, and replace following
    function ob_callback(&$buffer)
    with
    function ob_callback($buffer)
  3.  Save it.

 

  • Archives