Author Topic: PHP 7  (Read 12002 times)

0 Members and 1 Guest are viewing this topic.

Offline Parado

  • Pre-Newbie
  • Posts: 3
    • View Profile
PHP 7
« on: May 02, 2017, 06:20:31 PM »
Ich hab Problem mit PHP 7 und zwar bekomm ich FATAL ERROR von db_mysql.

Version ist 1.8

In Moment hab ich die Seite auf PHP 5.6 gestellt bis ich eine Lösung habe.


Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.873
    • View Profile
Re: PHP 7
« Reply #1 on: May 02, 2017, 06:45:58 PM »
Hallo,

Du müsstes die Möglichkeit habe die Einstellung selbst vornehmen zu können.

Stelle bitte auf 7 im Webspace um.


nobby

Offline Parado

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: PHP 7
« Reply #2 on: May 02, 2017, 07:17:03 PM »
Nach der Umstellung auf PHP 7

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /www/htdocs/xxxxxe4/media/includes/db_mysql.php:37 Stack trace: #0 /www/htdocs/xxxxxxxx/media/global.php(400): Db->__construct('localhost', 'xxxxxxx', 'xxxxxxxxx...', 'xxxxx') #1 /www/htdocs/xxxxxxx/media/index.php(30): include('/www/htdocs/w00...') #2 {main} thrown in /www/htdocs/xxxxx/media/includes/db_mysql.php on line 37

Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.873
    • View Profile
Re: PHP 7
« Reply #3 on: May 02, 2017, 07:27:43 PM »
Ja das must Du dier mal Anschauen /media/includes/db_mysql.php in Zeile 37 dort meldet er schwerwiegenden Fehler

nobby

Offline Parado

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: PHP 7
« Reply #4 on: May 02, 2017, 08:17:32 PM »
Funktioniert jetzt hab auf mysqli umgestellt

Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.873
    • View Profile
Re: PHP 7
« Reply #5 on: May 02, 2017, 08:20:59 PM »
Funktioniert jetzt hab auf mysqli umgestellt

 :thumbup: :thumbup: :wink:

Offline heinier

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Matzlpage.de
Re: PHP 7
« Reply #6 on: May 07, 2017, 05:51:20 PM »
Hi,

ich habe heute auch das Update auf 1.8 vorgenommen und auch bei meinem Provider auf php 7.0 umgestellt.

Jetzt kommt bei mir eine ähnliche Meldung wie bei Parado:

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /customers/f/1/1/xxxxxxxx.de/httpd.www/includes/db_mysql.php:39 Stack trace: #0 /customers/f/1/1/xxxxxxxx.de/httpd.www/global.php(407): Db->__construct('xxxxxxxx', 'xxxxxxxx', 'xxxxxxxx', 'xxxxxxxx') #1 /customers/f/1/1/xxxxxxxx.de/httpd.www/index.php(32): include('/customers/f/1/...') #2 {main} thrown in /customers/f/1/1/xxxxxxxx.de/httpd.www/includes/db_mysql.php on line 39

Zeile 39 in der db_mysql.php lautet:

37             function __construct($db_host, $db_user, $db_password = "", $db_name = "", $db_pconnect = 0) {
38            $connect_handle = ($db_pconnect) ? "mysql_pconnect" : "mysql_connect";
39            if (!$this->connection = @$connect_handle($db_host, $db_user, $db_password)) {
40            $this->error("Could not connect to the database server (".safe_htmlspecialchars($db_host).", ".safe_htmlspecialchars($db_user).").", 1);
 41             }

Vielleicht könnte Parado mir bitte mal erklären, was er auf mysql umgestellt hat.

Gruß Heinier
« Last Edit: May 07, 2017, 06:09:45 PM by heinier »

Offline dneibert

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: PHP 7
« Reply #7 on: July 18, 2017, 05:07:42 AM »
I have the same issue with PHP7. If anyone could post a fix when they figure it out, that would be great. Thanks!

Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.873
    • View Profile
Re: PHP 7
« Reply #8 on: July 18, 2017, 08:10:08 AM »
Hi,

Change the database to mysqli.

Then there should be no error message.

nobby

Offline dneibert

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: PHP 7
« Reply #9 on: July 18, 2017, 05:36:11 PM »
Hi,

Change the database to mysqli.

Then there should be no error message.

nobby

Thanks for the response but how do I change my database to "mysqli"?

Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.873
    • View Profile
Re: PHP 7
« Reply #10 on: July 18, 2017, 07:38:03 PM »
In the CONFIG.PHP

This is where you put it  :arrow: $db_servertype = 'mysqli';

config.php
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: config.php                                           *
 *        Copyright: (C) 2002-2016 4homepages.de                          *
 *            Email: 4imges@4homepages.de                                 *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.8                                                  *
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

date_default_timezone_set("Europe/Berlin");
$db_servertype 'mysqli';
$db_host 'localhost';
$db_name 'xxxxxxx';
$db_user 'xxxxxxx';
$db_password 'xxxxxxxxxx';
$table_prefix '4images_';
define("4IMAGES_ACTIVE"1);
?>


The two files db_mysql.php and db_mysqli.php are available under 4images in the directory Include.

If the entry in the config.php is present you have another problem.


nobby
« Last Edit: July 18, 2017, 07:56:15 PM by nobby »

Offline dneibert

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: PHP 7
« Reply #11 on: July 18, 2017, 07:58:36 PM »
Thank you so much!  :D

Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.873
    • View Profile
Re: PHP 7
« Reply #12 on: July 18, 2017, 08:16:10 PM »
Thank you so much!  :D

If you can help you should do it  :wink: