Change php.ini to production version
Posted by: Newfloridian (---.16-2.cable.virginm.net)
Date: November 26, 2017 10:36AM

I have my site running on Wamp64 quite happily with options PHP5.6 and PHP7.0.10 A couple of days ago I added the PHP7.1.2 module. I was already aware of the added stringency of some errors messages - most of which have been relatively easy to fix. I have been left with one "deprecation" error which I have been unable to fix (and strangely does not occur with a contact of mine using the same arrangement).

My question is: how do I change the environment in php.ini from development to production - particulalry changing the error message reporting from E_ALL to E_ALL & ~E_DEPRECATED & ~E_STRICT?

Many thanks

Alan

Options: ReplyQuote
Re: Change php.ini to production version
Posted by: Otomatic (Moderator)
Date: November 26, 2017 10:57AM

Hi,

Edit the file with a good text editor i.e. not notepad.exe

Left-Click Wampmanager tray icon -> PHP -> php.ini

what corresponds to the file wamp64/bin/php/php7.1.2/phpForApache.ini

then replace :
error_reporting = E_ALL
by
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
Save the modified file then:

Right-Click Wampmanager tray icon -> Refresh

> "deprecation" error which I have been unable to fix (and strangely does not occur
> with a contact of mine using the same arrangement).
Not the same PHP parameters!
What is the exact and complete wording of the error?

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.1 32 bit - Apache 2.4.29 - PHP 7.2.0/7.1.12/7.0.26/5.6.32 - MySQL 5.7.20 - MariaDB 10.2.9
Wampserver 3.1.1 64 bit - Apache 2.4.29 - PHP 7.2.0/7.1.12/7.0.26/5.6.32 - MySQL 5.7.20 - MariaDB 10.2.9
PhPMyAdmin 4.7.5 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Change php.ini to production version
Posted by: Newfloridian (---.16-2.cable.virginm.net)
Date: November 26, 2017 11:07AM

The error arises (five times) from the Administration section of the Lazarus Guestbook (v 1.24)

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP It then lists gb_admin has a deprecated constructor in \lib\admin.class.php on line 14
and similar errors for gbook_sql; gb_image; gb_template and gb_session

The form PHP seems to be complaining about is

 
class gb_admin
{
 
   var $db;
   var $gbsession;
   var $SELF;
   var $uid;
   var $VARS;
   var $table;
   var $GBLOGOUT;
   var $LANG;
 

   function gb_admin($gbsession,$uid)
   {
      global $_SERVER;

where class and function have been given the same names.

As mentioned in my initial post this has only started to occur with 7.1.2
The Lazarus GB is very popular amongst our own community. Unfortunately the Lazarus site (and its webmaster) are currently offline and not contactable.

Alan



Edited 1 time(s). Last edit at 11/26/2017 05:30PM by RiggsFolly.

Options: ReplyQuote
Re: Change php.ini to production version
Posted by: Newfloridian (---.16-2.cable.virginm.net)
Date: November 26, 2017 11:15AM

Sorry, should have said - uploaded version 7.1.12
When I left click on PHP and then php.ini the file pulled up in CodeLobster has come from the directory
wamp64/bin/apache/apache2.4.23/bin/php.ini
There was no mention of the PHP version number in the address - is this correct?

Alan

Options: ReplyQuote
Re: Change php.ini to production version
Posted by: Newfloridian (---.16-2.cable.virginm.net)
Date: November 26, 2017 12:33PM

OK - done as you suggested and that has depressed the error messages

Thank you

Alan

Options: ReplyQuote
Re: Change php.ini to production version
Posted by: Otomatic (Moderator)
Date: November 26, 2017 12:48PM

Hi,

> Deprecated: Methods with the same name as their class will not be constructors in a future version
> of PHP It then lists gb_admin has a deprecated constructor in \lib\admin.class.php on line 14

It is not very difficult to correct.

If there is in a class a "construct" function name with the same name as the class, like this:
class DBLayer {
	var $prefix;
....
	function DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix ...
You have to replace the name of the construct function by __construct, like this:
class DBLayer {
	var $prefix;
....
	function __construct($db_host, $db_username, $db_password, $db_name, $db_prefix ...

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.1 32 bit - Apache 2.4.29 - PHP 7.2.0/7.1.12/7.0.26/5.6.32 - MySQL 5.7.20 - MariaDB 10.2.9
Wampserver 3.1.1 64 bit - Apache 2.4.29 - PHP 7.2.0/7.1.12/7.0.26/5.6.32 - MySQL 5.7.20 - MariaDB 10.2.9
PhPMyAdmin 4.7.5 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Change php.ini to production version
Posted by: Newfloridian (---.16-2.cable.virginm.net)
Date: November 26, 2017 03:41PM

Thank you Otomatic

Can I be absolutely crystal clear about the formatting of that new structure. Is it really:

function space underscore underscoreconstruct(

function __construct(

It's not particularly easy to read and is certainly not self-evident

Alan

Options: ReplyQuote
Re: Change php.ini to production version
Posted by: RiggsFolly (Moderator)
Date: November 26, 2017 05:33PM

Hi,

If you are not sure of the format, please try looking at the PHP Manual It should be your first port of call for any PHP related questions.

Thi shas nothing to do with WAMPServer

---------------------------------------------------------------------------------------------
(Windows 7 Pro 32bit) (Wampserver 3.0.6 32bit)
<Apache 2.4.23/2.2.31> < 7.2/PHP 7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.10/5.6.17/5.5.28>
<MariaDB 10.1.21> <phpMyAdmin4.7.5> <MySQL Workbench 6.3.6.511>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin -- WAMPServer alternate Repo
-?-?-?- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -?-?-?-

Options: ReplyQuote


Sorry, only registered users may post in this forum.