Announcement

#1 2018-03-10 17:54:43

danibo
Member
Zurich
2009-10-07
40

No access after Apache update

Hello

After a server update my piwigo installation behave strange...
I hope it is only a PHP or MySQL setting which is wrong...
thanks for any hint.

When i enter the path:
http://www.bilderlager.ch/fideco/
http://www.bilderlager.ch/wallisellen/

I get this failure message in the browser:
Fatal error: Class 'mysqli' not found in /home/bilderla/public_html/fideco/include/dblayer/functions_mysqli.inc.php on line 67

or it downloads a file with following input
http://www.bilderlager.ch/batbu/

It downloads immidiately a file:

<?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']) )
{
  //----------------------------------------------------- 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() and $conf['index_edit_icon'])
  {
    $template->assign(
      'U_EDIT',
      get_root_url().'admin.php?page=album-'.$page['category']['id']
      );
  }

  if (is_admin() and !empty($page['items']) and $conf['index_caddie_icon'])
  {
    $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 or $conf['album_description_on_all_pages']) 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');






(Here your message)

Piwigo version: I think they are all 2.9.3
PHP version:
MySQL version:
Piwigo URL: http://

http://www.bilderlager.ch/fideco/

http://www.bilderlager.ch/batbu/


Server Name    server
cPanel Version    68.0 (build 30)
Apache Version    2.2.34
PHP Version    5.6.34
MySQL Version    5.5.58-cll
Architecture    x86_64
Operating System    linux
Shared IP Address    162.144.61.20
Path to Sendmail    /usr/sbin/sendmail
Path to Perl    /usr/bin/perl
Perl Version    5.10.1
Kernel Version    2.6.32-696.20.1.el6.x86_64


Please tell that it is only a small failure which i can fix easy with some setting or so...

All the best and many thanks in advance for any feedback
danibo

Offline

 

#2 2018-03-10 18:38:03

erAck
Member
2015-09-06
114

Re: No access after Apache update

If every .php file was presented as download then I'd say the Apache mod_php is missing, but it seems to be only for http://www.bilderlager.ch/batbu/ not the other directories. Maybe check .htaccess files or other per directory settings in your Apache setup.

And really, pasting the entire .php file was unnecessary.

For/against Fatal error: Class 'mysqli' not found install the PHP MySQLi package, as about every hit for https://duckduckgo.com/?q="Fatal+e … ound" indicates..

Offline

 

#3 2018-03-12 14:10:48

danibo
Member
Zurich
2009-10-07
40

Re: No access after Apache update

erAck
Thanks for your feedback and sorry for uploading the PHP file.

We could solve the problem for most Piwigo installations. see below.

At www.bilderlager.ch/wallisellen
I get now an other failure message

Fatal error: Call to undefined function mb_strtoupper() in /home/bilderla/public_html/wallisellen/plugins/PWG_Stuffs/modules/Tags/main.inc.php on line 58

unfortunatly I can not log in to the administration page by using this link:
http://www.bilderlager.ch/wallisellen/i … cation.php and disable or update the plugin.

What do you recommend?
Going their by FTP and rename or delete it?

All the best and thanks
Daniel


The reason why http://www.bilderlager.ch/batbu/ was downloading a PHP file instead of displaying the content is because of the code "AddType application/x-httpd-ea-php56 .php" that was in the /home/bilderla/public_html/batbu/.htaccess file. Your server has PHP 5.6 installed and running as the default/only PHP version. PHP handler code such as this should not be used when the server default PHP version is identical to the version being called in the PHP handler code (or if the PHP handler code is attempting to call a PHP version that isn't installed), elsewise this problem results. I've gotten this resolved on http://www.bilderlager.ch/batbu/ by renaming /home/bilderla/public_html/batbu/.htaccess to /home/bilderla/public_html/batbu/.htaccess.1520849921.bak to disable the file.

After this update, http://www.bilderlager.ch/batbu/ was loading the error "Fatal error: Class 'mysqli' not found in /home/bilderla/public_html/batbu/include/dblayer/functions_mysqli.inc.php on line 67" error as seen at http://www.bilderlager.ch/wallisellen/ . I looked a little deeper into this problem - your PHP installation currently has the mysql and mysqlnd extensions compiled, but not the mysqli extension. So, this coding error appears to be related to the fact that mysqli is required but not present. This is something we can help with! I've run a recomile of PHP to include the mysqli extension. Now, the URL http://www.bilderlager.ch/wallisellen/ shows a different error message indicating a faulty plugin (you would need to disable/remove or have a developer fix), and http://www.bilderlager.ch/batbu/ is loading normally.

Offline

 

#4 2018-03-12 18:20:31

flop25
Piwigo Team
2006-07-06
6838

Re: No access after Apache update

many extensions for Php seems missing... your web hoster is clearly incompetent!

mb_strtoupper is a fucntion from PHP http://php.net/manual/fr/function.mb-strtoupper.php , specifically from the mbstring php module which is obviously missing


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#5 2018-03-15 10:39:10

danibo
Member
Zurich
2009-10-07
40

Re: No access after Apache update

Thanks your input to the hoster helped... ;-)
Piwigo www.bilderlager.ch/wallisellen is running again.
danibo

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2018 · Contact