Announcement

#1 2016-10-02 11:46:46

Joe
Guest

Ubuntu Update 16.04

Hi,

I updated my Ubuntu Server to 16.04 without informing myself before. Now my Site only shows:

Code:

<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery                                    |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team                  http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify  |
// | it under the terms of the GNU General Public License as published by  |
// | the Free Software Foundation                                          |
// |                                                                       |
// | This program is distributed in the hope that it will be useful, but   |
// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
// | General Public License for more details.                              |
// |                                                                       |
// | You should have received a copy of the GNU General Public License     |
// | along with this program; if not, write to the Free Software           |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA.                                                                  |
// +-----------------------------------------------------------------------+

//--------------------------------------------------------------------- include
define('PHPWG_ROOT_PATH','./');
include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
include(PHPWG_ROOT_PATH.'include/section_init.inc.php');

// Check Access and exit when user status is not ok
check_status(ACCESS_GUEST);


// access authorization check
if (isset($page['category']))
{
  check_restrictions($page['category']['id']);
}
if ($page['start']>0 && $page['start']>=count($page['items']))
{
  page_not_found('', duplicate_index_url(array('start'=>0)));
}

trigger_notify('loc_begin_index');

//---------------------------------------------- change of image display order
if (isset($_GET['image_order']))
{
  if ( (int)$_GET['image_order'] > 0)
  {
    pwg_set_session_var('image_order', (int)$_GET['image_order']);
  }
  else
  {
    pwg_unset_session_var('image_order');
  }
  redirect(
    duplicate_index_url(
      array(),        // nothing to redefine
      array('start')  // changing display order goes back to section first page
      )
    );
}
if (isset($_GET['display']))
{
  $page['meta_robots']['noindex']=1;
  if (array_key_exists($_GET['display'], ImageStdParams::get_defined_type_map()))
  {
    pwg_set_session_var('index_deriv', $_GET['display']);
  }
}

//-------------------------------------------------------------- initialization
// navigation bar
$page['navigation_bar'] = array();
if (count($page['items']) > $page['nb_image_page'])
{
  $page['navigation_bar'] = create_navigation_bar(
    duplicate_index_url(array(), array('start')),
    count($page['items']),
    $page['start'],
    $page['nb_image_page'],
    true, 'start'
    );
}

$template->assign('thumb_navbar', $page['navigation_bar'] );

// caddie filling :-)
if (isset($_GET['caddie']))
{
  fill_caddie($page['items']);
  redirect(duplicate_index_url());
}

if (isset($page['is_homepage']) and $page['is_homepage'])
{
  $canonical_url = get_gallery_home_url();
}
else
{
  $start = $page['nb_image_page'] * round($page['start'] / $page['nb_image_page']);
  if ($start>0 && $start >= count($page['items']) )
  {
    $start -= $page['nb_image_page'];
  }
  $canonical_url = duplicate_index_url(array('start' => $start));
}
$template->assign('U_CANONICAL', $canonical_url);

//-------------------------------------------------------------- page title
$title = $page['title'];
$template_title = $page['section_title'];
if (count($page['items']) > 0)
{
  $template_title.= ' ['.count($page['items']).']';
}
$template->assign('TITLE', $template_title);

//-------------------------------------------------------------- menubar
include( PHPWG_ROOT_PATH.'include/menubar.inc.php');

$template->set_filename('index', 'index.tpl');

// +-----------------------------------------------------------------------+
// |  index page (categories, thumbnails, search, calendar, random, etc.)  |
// +-----------------------------------------------------------------------+
if ( empty($page['is_external']) or !$page['is_external'] )
{
  //----------------------------------------------------- template initialization
  $page['body_id'] = 'theCategoryPage';
  
  if (isset($page['flat']) or isset($page['chronology_field']))
  {
    $template->assign(
      'U_MODE_NORMAL',
      duplicate_index_url( array(), array('chronology_field', 'start', 'flat') )
      );
  }

  if ($conf['index_flat_icon'] and !isset($page['flat']) and 'categories' == $page['section'])
  {
    $template->assign(
      'U_MODE_FLAT',
      duplicate_index_url(array('flat' => ''), array('start', 'chronology_field'))
      );
  }

  if (!isset($page['chronology_field']))
  {
    $chronology_params = array(
      'chronology_field' => 'created',
      'chronology_style' => 'monthly',
      'chronology_view' => 'list',
      );
    if ($conf['index_created_date_icon'])
    {
      $template->assign(
        'U_MODE_CREATED',
        duplicate_index_url( $chronology_params, array('start', 'flat') )
        );
    }
    if ($conf['index_posted_date_icon'])
    {
      $chronology_params['chronology_field'] = 'posted';
      $template->assign(
        'U_MODE_POSTED',
        duplicate_index_url( $chronology_params, array('start', 'flat') )
        );
    }
  }
  else
  {
    if ($page['chronology_field'] == 'created')
    {
      $chronology_field = 'posted';
    }
    else
    {
      $chronology_field = 'created';
    }
    if ($conf['index_'.$chronology_field.'_date_icon'])
    {
      $url = duplicate_index_url(
                array('chronology_field'=>$chronology_field ),
                array('chronology_date', 'start', 'flat')
              );
      $template->assign(
          'U_MODE_'.strtoupper($chronology_field),
          $url
        );
    }
  }

  if ('search' == $page['section'])
  {
    $template->assign(
      'U_SEARCH_RULES',
      get_root_url().'search_rules.php?search_id='.$page['search']
      );
  }

  if (isset($page['category']) and is_admin())
  {
    $template->assign(
      'U_EDIT',
      get_root_url().'admin.php?page=album-'.$page['category']['id']
      );
  }

  if (is_admin() and !empty($page['items']))
  {
    $template->assign(
      'U_CADDIE',
       add_url_params(duplicate_index_url(), array('caddie'=>1) )
      );
  }

  if ( $page['section']=='search' and $page['start']==0 and
      !isset($page['chronology_field']) and isset($page['qsearch_details']) )
  {
    $cats = array_merge(
        (array)@$page['qsearch_details']['matching_cats_no_images'],
        (array)@$page['qsearch_details']['matching_cats'] );
    if (count($cats))
    {
      usort($cats, 'name_compare');
      $hints = array();
      foreach ( $cats as $cat )
      {
        $hints[] = get_cat_display_name( array($cat), '' );
      }
      $template->assign( 'category_search_results', $hints);
    }

    $tags = (array)@$page['qsearch_details']['matching_tags'];
    foreach ( $tags as $tag )
    {
      $tag['URL'] = make_index_url(array('tags'=>array($tag)));
      $template->append( 'tag_search_results', $tag);
    }
    
    if (empty($page['items']))
    {
      $template->append( 'no_search_results', htmlspecialchars($page['qsearch_details']['q']));
    }
    elseif (!empty($page['qsearch_details']['unmatched_terms']))
    {
      $template->assign( 'no_search_results', array_map('htmlspecialchars', $page['qsearch_details']['unmatched_terms']));
    }
  }

  // image order
  if ( $conf['index_sort_order_input']
      and count($page['items']) > 0
      and $page['section'] != 'most_visited'
      and $page['section'] != 'best_rated')
  {
    $preferred_image_orders = get_category_preferred_image_orders();
    $order_idx = pwg_get_session_var( 'image_order', 0 );
    
    // get first order field and direction
    $first_order = substr($conf['order_by'], 9);
    if (($pos = strpos($first_order, ',')) !== false)
    {
      $first_order = substr($first_order, 0, $pos);
    }
    $first_order = trim($first_order);
    
    $url = add_url_params(
            duplicate_index_url(),
            array('image_order' => '')
          );
    $tpl_orders = array();
    $order_selected = false;
    
    foreach ($preferred_image_orders as $order_id => $order)
    {
      if ($order[2])
      {
        // force select if the field is the first field of order_by
        if (!$order_selected && $order[1]==$first_order)
        {
          $order_idx = $order_id;
          $order_selected = true;
        }
        
        $tpl_orders[ $order_id ] = array(
          'DISPLAY' => $order[0],
          'URL' => $url.$order_id,
          'SELECTED' => $order_idx==$order_id,
          );
      }
    }
    
    $tpl_orders[0]['SELECTED'] = !$order_selected; // unselect "Default" if another one is selected
    $template->assign('image_orders', $tpl_orders);
  }

  // category comment
  if ($page['start']==0 and !isset($page['chronology_field']) and !empty($page['comment']) )
  {
    $template->assign('CONTENT_DESCRIPTION', $page['comment'] );
  }

  if ( isset($page['category']['count_categories']) and $page['category']['count_categories']==0 )
  {// count_categories might be computed by menubar - if the case unassign flat link if no sub albums
    $template->clear_assign('U_MODE_FLAT');
  }

  //------------------------------------------------------ main part : thumbnails
  if ( 0==$page['start']
    and !isset($page['flat'])
    and !isset($page['chronology_field'])
    and ('recent_cats'==$page['section'] or 'categories'==$page['section'])
    and (!isset($page['category']['count_categories']) or $page['category']['count_categories']>0 )
  )
  {
    include(PHPWG_ROOT_PATH.'include/category_cats.inc.php');
  }

  if ( !empty($page['items']) )
  {
    include(PHPWG_ROOT_PATH.'include/category_default.inc.php');
    $url = add_url_params(
            duplicate_index_url(),
            array('display' => '')
          );
    
    $selected_type = $template->get_template_vars('derivative_params')->type;
    $template->clear_assign( 'derivative_params' );
    $type_map = ImageStdParams::get_defined_type_map();
    unset($type_map[IMG_XXLARGE], $type_map[IMG_XLARGE]);
    
    foreach($type_map as $params)
    {
      $template->append(
        'image_derivatives',
        array(
          'DISPLAY' => l10n($params->type),
          'URL' => $url.$params->type,
          'SELECTED' => ($params->type == $selected_type ? true:false),
          )
        );
    }
  }

  // slideshow
  // execute after init thumbs in order to have all picture informations
  if (!empty($page['cat_slideshow_url']))
  {
    if (isset($_GET['slideshow']))
    {
      redirect($page['cat_slideshow_url']);
    }
    elseif ($conf['index_slideshow_icon'])
    {
      $template->assign('U_SLIDESHOW', $page['cat_slideshow_url']);
    }
  }
}

//------------------------------------------------------------ end
include(PHPWG_ROOT_PATH.'include/page_header.php');
trigger_notify('loc_end_index');
flush_page_messages();
$template->parse_index_buttons();
$template->pparse('index');

//------------------------------------------------------------ log informations
pwg_log();
include(PHPWG_ROOT_PATH.'include/page_tail.php');
?>

As you can see at segelflug.photos

What can I do to fix this?

 

#2 2016-10-02 14:01:24

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: Ubuntu Update 16.04

Hi Joe,

It looks like your web server can't process PHP scripts. Did you install php?

Offline

 

#3 2016-11-21 11:49:51

adgjh5RR
Member
2016-11-21
4

Re: Ubuntu Update 16.04

I have the same error, I've upgraded as well form Ubuntu server 14.04 to 16.04.

PHP is installed. Version 5 and 7, which probably is causing the error.
Removing php7.0 (sudo dpkg -r php7.0) gives an error, as php depends on it. Any ideas?


The output of dpkg -l | grep php shows:

rc  libapache2-mod-php5                5.5.9+dfsg-1ubuntu4.20              amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php                                1:7.0+35ubuntu6                     all          server-side, HTML-embedded scripting language (default)
ii  php-common                         1:35ubuntu6                         all          Common files for PHP packages
rc  php5-cli                           5.5.9+dfsg-1ubuntu4.20              amd64        command-line interpreter for the php5 scripting language
rc  php5-common                        5.5.9+dfsg-1ubuntu4.20              amd64        Common files for packages built from the php5 source
rc  php5-fpm                           5.5.9+dfsg-1ubuntu4.20              amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
rc  php5-gd                            5.5.9+dfsg-1ubuntu4.20              amd64        GD module for php5
rc  php5-json                          1.3.2-2build1                       amd64        JSON module for php5
rc  php5-mysql                         5.5.9+dfsg-1ubuntu4.20              amd64        MySQL module for php5
rc  php5-readline                      5.5.9+dfsg-1ubuntu4.20              amd64        Readline module for php5
ri  php7.0                             7.0.8-0ubuntu0.16.04.3              all          server-side, HTML-embedded scripting language (metapackage)
ri  php7.0-cli                         7.0.8-0ubuntu0.16.04.3              amd64        command-line interpreter for the PHP scripting language
ii  php7.0-common                      7.0.8-0ubuntu0.16.04.3              amd64        documentation, examples and common module for PHP
ii  php7.0-fpm                         7.0.8-0ubuntu0.16.04.3              amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php7.0-json                        7.0.8-0ubuntu0.16.04.3              amd64        JSON module for PHP
ii  php7.0-mysql                       7.0.8-0ubuntu0.16.04.3              amd64        MySQL module for PHP
ii  php7.0-opcache                     7.0.8-0ubuntu0.16.04.3              amd64        Zend OpCache module for PHP
ii  php7.0-readline                    7.0.8-0ubuntu0.16.04.3              amd64        readline module for PHP

Offline

 

#4 2016-11-21 12:11:04

adgjh5RR
Member
2016-11-21
4

Re: Ubuntu Update 16.04

I've tried a bit more:
- removed php7, based on this webpage: http://askubuntu.com/questions/768737/h … ve-php-5-6
- installed php 5.6, based on this webpage: http://askubuntu.com/questions/756181/i … nial-16-04

The error is now: Fatal error: Class 'mysqli' not found in /var/www/html/Fotos/include/dblayer/functions_mysqli.inc.php on line 67

Through ps ax I can see that mysqld is running.
The output of dpkg -l | grep php is now:
ii  libapache2-mod-php5.6              5.6.28-1+deb.sury.org~xenial+1      amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php-common                         1:45+deb.sury.org~xenial+1          all          Common files for PHP packages
ii  php5.6                             5.6.28-1+deb.sury.org~xenial+1      all          server-side, HTML-embedded scripting language (metapackage)
ii  php5.6-cli                         5.6.28-1+deb.sury.org~xenial+1      amd64        command-line interpreter for the PHP scripting language
ii  php5.6-common                      5.6.28-1+deb.sury.org~xenial+1      amd64        documentation, examples and common module for PHP
ii  php5.6-json                        5.6.28-1+deb.sury.org~xenial+1      amd64        JSON module for PHP
ii  php5.6-mbstring                    5.6.28-1+deb.sury.org~xenial+1      amd64        MBSTRING module for PHP
ii  php5.6-mcrypt                      5.6.28-1+deb.sury.org~xenial+1      amd64        libmcrypt module for PHP
ii  php5.6-mysql                       5.6.28-1+deb.sury.org~xenial+1      amd64        MySQL module for PHP
ii  php5.6-opcache                     5.6.28-1+deb.sury.org~xenial+1      amd64        Zend OpCache module for PHP
ii  php5.6-readline                    5.6.28-1+deb.sury.org~xenial+1      amd64        readline module for PHP
ii  php5.6-xml                         5.6.28-1+deb.sury.org~xenial+1      amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP

The output of php -r 'phpinfo();' | grep -i mysqli :
/etc/php/5.6/cli/conf.d/20-mysqli.ini,
mysqli
MysqlI Support => enabled
mysqli.allow_local_infile => On => On
mysqli.allow_persistent => On => On
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => no value => no value
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off
mysqli.rollback_on_cached_plink => Off => Off
API Extensions => mysql,mysqli,pdo_mysql

Last edited by adgjh5RR (2016-11-21 12:17:10)

Offline

 

#5 2016-11-21 19:49:44

adgjh5RR
Member
2016-11-21
4

Re: Ubuntu Update 16.04

Well, the above was enough, I found out later. It only required a reboot

Offline

 

#6 2016-11-28 09:41:55

adgjh5RR
Member
2016-11-21
4

Re: Ubuntu Update 16.04

Unfortunately it wasn't that easy. I couldn't add new foto's. The error was that the GD library didn't existed. The solution was to install the gd-library as well:

sudo apt-get install php5.6-gd
sudo systemctl restart apache2

Last edited by adgjh5RR (2016-11-28 09:46:57)

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact