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?

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

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 ...

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

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 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.