Tag: php

  • WHMCS cron job says ioncube not installed despite ioncube being installed

    This issue drove me batty for an hour – after installing WHMCS with PHP’s Ioncube extension installed successfully the cronjob required by WHMCS would not run, complaining about Ioncube not being installed. Yet php -v showed that it was in fact installed.

     

    What gives?

     

    Turns out that Ioncube had been enabled for PHP-FPM in the following directory:

     

    /etc/php/7.0/fpm/conf.d/

     

    …but had not been enabled in this directory also:

     

    /etc/php/7.0/cli/conf.d/

     

    …which is another directory that needs the same config file in. In my server’s case the config file was named 00-ioncube.ini and consisted of the following:

     

    zend_extension = “/usr/lib/php/20151012/ioncube_loader_lin_7.0.so”

     

    And with that, voila, cron job works. Can’t get that hour of my life back, though.

     

    Update: For the php7.1 servers the zend_extension line read:

     

    zend_extension = “/usr/lib/php/20160303/ioncube_loader_lin_7.1.so”

  • Upload error 413 “Request Entity Too Large” on Nginx

    When trying to upload files to a Drupal installation running on nginx, we got a 413 error: Request Entity too large.

     

    We had gone through and updated the php files with regard to max upload file size limits, but had neglected to do the same to the nginx config file (/etc/nginx/nginx.conf on Debian). We had to add the following line:

    client_max_body_size 20M;

     

    in the http block and restart the nginx server to get uploads working again. The above will set the limit to 20MB; change it to suit your own environment and needs.

     

    You can also add this to the server or location blocks.

  • Ubuntu: How to update PHP’s timezone

     

    We came across this one recently when setting up a Zabbix server, where the installation would not proceed until the PHP timezone was set. This is quite straightforward – using your favourite editor edit:

     

    /etc/php5/apache2/php.ini

     

    Look for the Module Settings section or search for:

     

     date.timezone

     

    (in vi /date.timezone should get you there). Uncomment the line by removing the leading ; and then add in your desired timezone. For Sydney it would look like:

     

    [Date]

    ; Defines the default timezone used by the date functions

    ; http://php.net/date.timezone

    date.timezone = UTC+10

     

    Change UTC+10 to your desired timezone, save the file and restart Apache:

     

    sudo service apache2 restart

     

    Voila!