Constant STORED_DATA already defined in.....
Posted by: MigSelv (---.dk.customer.tdc.net)
Date: November 12, 2014 10:29AM

My setup: 12.Nov.2014
Ver.Windows 32
Ver.Wamp 32
Ver.Apache 2.4.9
Ver.MySQL 5.6.17
Ver.PHP 5.5.12
- -


Hi WAMP,ers :-)

Have a external poll plugin to my Osclass
which works 100% perfectly on my hosted On.Line server

But on my Off.Line local WAMP - it does not work,
I just get the following error message:

* Constant STORED_DATA already defined in
(and then with error reffs to many plugin files)
- -

I then asked the guy who wrote the plugin why ?
but he simply replied, that when it worked On.Line
(and also without problems on his local Apache server)
-
>>sorry then you have a problem with your wamp
- -

? I,m lost ?

Regards: MigSelv
.

Options: ReplyQuote
Re: Constant STORED_DATA already defined in.....
Posted by: Otomatic (Moderator)
Date: November 12, 2014 11:07AM

Hi,

>>sorry then you have a problem with your wamp
NO, NO and NO!
There are some errors in the plugin, but the developer mask these errors in php.ini file.
It's still not complicated, before defining a constant to check if it is not already defined:

In development is a very bad solution to hide his own mistakes.

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



Edited 1 time(s). Last edit at 11/12/2014 03:52PM by Otomatic.

Options: ReplyQuote
Re: Constant STORED_DATA already defined in.....
Posted by: MigSelv (---.dk.customer.tdc.net)
Date: November 12, 2014 07:59PM

Hi Otomatic

You're probably right in your considerations,
but my problem is I,m webmaster, not coder,
so I,m is forced to believe in you guys.

But on the other hand, he also have a point,
It works on my hosting plan - but not WAMP local
Why this difference ?

I think this is part of the villain,
<?php define( 'STORED_DATA', dirname(dirname(__FILE__)) . "/poll_data/" );
but I can not solve the ..define.. puzzle,
- -

So I,m just sitting between two chairs (again) ha,, ha,, ha,,

Regards: MigSelv
.

Options: ReplyQuote
Re: Constant STORED_DATA already defined in.....
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: November 13, 2014 01:53AM

Hello MigSel

Here is the nornal work around for this situation.

There is a parameter in the php.ini file that controls the display of errors generated by the PHP interpreter called 'display_errors'. It can be 'On' or 'Off' and it controls whether errors are displayed on the browser or not.


To get this code to run, you have to set it to

display_errors = Off


Good developers will have this turned ON so that they can See and FIX errors in their code, but on a live server you would turn it OFF as you do not want this information going to a user as it might expose too much information to a hacker. Obviously the developer of this code does not fall into this category.

Now WAMPServer is designed to be a primarily a developers tool, so it comes with this parameter turned on.

To turn it off, edit the php.ini file, using the wampmanager menus like so :-

wampmanager -> PHP -> php.ini

Find
display_errors = On

and change it to

display_errors = Off

Save the php.ini file, and then restart Apache

wampmanager -> Apache -> Service -> Restart Service


Unfortunately this does mean to see any errors while you are developing you will need to look at the 'php error log' a file that lives in the \wamp\logs folder

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



Edited 1 time(s). Last edit at 11/13/2014 09:36AM by Otomatic.

Options: ReplyQuote
Re: [ SOLVED ] ... Constant STORED_DATA already defined in.....
Posted by: MigSelv (---.dk.customer.tdc.net)
Date: November 13, 2014 10:20AM

Dear RiggsFolly

many many THANK,s
I give a cold, next time you are in Copenhagen - ha,,ha,, :-)
- -

I understand exactly what you and Otomatic expressed as pro coders,
but unfortunately we live in a ,,new-quick-world,,
where people almost always jumps over to cut easy corners.
- -

And I,m too old (64) to start over learning real coding.
You guys must have a nice day,

Regards: MigSelv
.

Options: ReplyQuote
Re: Constant STORED_DATA already defined in.....
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: November 13, 2014 10:32AM

Great,

It's been to long since my last visit to Denmark.

---------------------------------------------------------------------------------------------
(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
Re: Constant STORED_DATA already defined in.....
Posted by: Otomatic (Moderator)
Date: November 13, 2014 11:07AM

Hi,

Quote
MigSelv
And I,m too old (64) to start over learning real coding.
I was born before the D-Day invasion winking smiley

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

Options: ReplyQuote


Sorry, only registered users may post in this forum.