Throwing of Constant [...] already defined messages

1,361 views
Skip to first unread message

gabriel2029

unread,
Aug 8, 2016, 12:50:43 PM8/8/16
to Orangescrum Community Support
Hi! I have the problem that PHP is always throing errors like

[Mon Aug 08 10:57:11.497921 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant EMAIL_DELIVERY already defined in /var/www/html/orangescrum/app/Config/constants.php on line 12
[Mon Aug 08 10:57:11.497958 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant SMTP_HOST already defined in /var/www/html/orangescrum/app/Config/constants.php on line 17
[Mon Aug 08 10:57:11.497965 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant SMTP_PORT already defined in /var/www/html/orangescrum/app/Config/constants.php on line 18
[Mon Aug 08 10:57:11.497971 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant SMTP_UNAME already defined in /var/www/html/orangescrum/app/Config/constants.php on line 19
[Mon Aug 08 10:57:11.497977 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant SMTP_PWORD already defined in /var/www/html/orangescrum/app/Config/constants.php on line 20
[Mon Aug 08 10:57:11.497983 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant WEB_DOMAIN already defined in /var/www/html/orangescrum/app/Config/constants.php on line 48
[Mon Aug 08 10:57:11.497988 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant FROM_EMAIL_NOTIFY already defined in /var/www/html/orangescrum/app/Config/constants.php on line 49
[Mon Aug 08 10:57:11.497994 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant SUPPORT_EMAIL already defined in /var/www/html/orangescrum/app/Config/constants.php on line 50
[Mon Aug 08 10:57:11.498001 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant FROM_EMAIL already defined in /var/www/html/orangescrum/app/Config/constants.php on line 51
[Mon Aug 08 10:57:11.498006 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant DEV_EMAIL already defined in /var/www/html/orangescrum/app/Config/constants.php on line 53
[Mon Aug 08 10:57:11.498012 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant EMAIL_SUBJ already defined in /var/www/html/orangescrum/app/Config/constants.php on line 54
[Mon Aug 08 10:57:11.498018 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant EMAIL_REPLY already defined in /var/www/html/orangescrum/app/Config/constants.php on line 57
[Mon Aug 08 10:57:11.498024 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant RELEASE already defined in /var/www/html/orangescrum/app/Config/constants.php on line 59
[Mon Aug 08 10:57:11.498029 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant SUB_FOLDER already defined in /var/www/html/orangescrum/app/Config/constants.php on line 62
[Mon Aug 08 10:57:11.498038 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant PROTOCOL already defined in /var/www/html/orangescrum/app/Config/constants.php on line 69
[Mon Aug 08 10:57:11.498046 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant DOMAIN already defined in /var/www/html/orangescrum/app/Config/constants.php on line 71
[Mon Aug 08 10:57:11.498053 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant HTTP_SERVER already defined in /var/www/html/orangescrum/app/Config/constants.php on line 75
[Mon Aug 08 10:57:11.498059 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant HTTP_ROOT already defined in /var/www/html/orangescrum/app/Config/constants.php on line 76
[Mon Aug 08 10:57:11.498083 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant DOMAIN_COOKIE already defined in /var/www/html/orangescrum/app/Config/constants.php on line 77
[Mon Aug 08 10:57:11.498095 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant HTTP_APP already defined in /var/www/html/orangescrum/app/Config/constants.php on line 78
[Mon Aug 08 10:57:11.498106 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant HTTPS_HOME already defined in /var/www/html/orangescrum/app/Config/constants.php on line 79
[Mon Aug 08 10:57:11.498117 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant HTTP_HOME already defined in /var/www/html/orangescrum/app/Config/constants.php on line 80
[Mon Aug 08 10:57:11.498127 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant CLIENT_ID already defined in /var/www/html/orangescrum/app/Config/constants.php on line 83
[Mon Aug 08 10:57:11.498138 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant CLIENT_ID_NUM already defined in /var/www/html/orangescrum/app/Config/constants.php on line 84
[Mon Aug 08 10:57:11.498147 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant CLIENT_SECRET already defined in /var/www/html/orangescrum/app/Config/constants.php on line 85
[Mon Aug 08 10:57:11.498154 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant API_KEY already defined in /var/www/html/orangescrum/app/Config/constants.php on line 86
[Mon Aug 08 10:57:11.498160 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant REDIRECT_URI already defined in /var/www/html/orangescrum/app/Config/constants.php on line 87


in the apache error.log when interacting with the panel. Curiously, the website is working without any problems.

Can I fix the errors?

Mfg gabriel2029

Brad A.

unread,
Sep 6, 2016, 4:49:45 PM9/6/16
to Orangescrum Community Support
Going to +1 this. Having the same issue. My logs are basically the same but show the referer to be /dashboard.

I am experiencing a bit of a slowdown when this occurs. Site functionality doesn't seem to be affected but it can take a while to post or get anything that might be in progress.

I have yet to see any constant with where this occurs though I notice it mostly when posting data in the form of a new task or Project.

Damien Hull

unread,
Sep 14, 2016, 7:44:44 PM9/14/16
to Orangescrum Community Support
Same thing on my system. I just installed orangescrum on Ubuntu 14.04. Can't update the user profile and I have the same things in my Apache error logs. Everything else seems to work though. I hope there is a fix for this. I would love to use this application. If the bugs don't get fixed soon I'll have to find something else. 

Team Orangescrum

unread,
Oct 3, 2016, 9:03:33 AM10/3/16
to Orangescrum Community Support
Hi,

Can you please check whether the debug value is on or off?

Please do the following changes to the core.php file.
Replace Configure::write('debug',2); with Configure::write('debug',0);

Let us know if you have any more queries.

Brad A.

unread,
Oct 13, 2016, 11:01:54 AM10/13/16
to Orangescrum Community Support
I am having the same issue and can verify that debug is set to 0 in my core.php. I am running CentOS 6 in this case.

Daniel Soares

unread,
Oct 17, 2016, 11:13:48 AM10/17/16
to Orangescrum Community Support
On Thursday, October 13, 2016 at 12:01:54 PM UTC-3, Brad A. wrote:
I am having the same issue and can verify that debug is set to 0 in my core.php. I am running CentOS 6 in this case.


Same issue with same config here! 

Team Orangescrum

unread,
Oct 25, 2016, 1:30:41 AM10/25/16
to Orangescrum Community Support
 Hi Guys

 To stop seeing these PHP notices, you have to turn off PHP Notice in php configuration file.
 In order to do that please follow the below link:

 http://stackoverflow.com/questions/2867057/how-do-i-turn-off-php-notices

Best Regards
Team OrangeScrum

John Miller

unread,
Jul 17, 2017, 7:24:32 AM7/17/17
to Orangescrum Community Support
Hi Gabriel (and others),

I would like to offer an alternative to Team Orangescrum's suggestions.

For reference:
Team Orangescrum reply #1: "Replace Configure::write('debug',2); with Configure::write('debug',0); in core.php" => This setting is unrelated and wont change anything.
Team Orangescrum reply #2: "To stop seeing these PHP notices, you have to turn off PHP Notice in php configuration file." => That indeed hides the notices. Actually, that suppresses all php warnings of the same verbose level you would usually like to take note of. They normally indicate possible flaws even if it's only notices. Trying to define constants several times definitely is such an issue.

Background:
In Orangescrum constants are not defined in different parts of the code. However, app/Config/constants.php is included multiple times if you request a page:
  • app\Config\core.php =>calls install.php first, then uses "include(...)" => NOK, see description of problem below!
  • app\Config\install.php  => uses "include_once(...)" => OK (but also rewrites/changes constants.php in function check_subfolder()!)
  • app\webroot\EmailReply.php => uses "include_once(...)" => OK
  • app\webroot\users\image_thumb\index.php => uses "include(...)" with error_reporting(0) => OK (not nice, but works)
Problem:
On every (!) page request OrangeScrum calls install.php. There, function check_subfolder() is always executed (on line 174), even if your installation is fully configured and up and running. [Sidenote: IMO this function is not even necessary at all but rather superfluous. check_subfolder searches and replaces the default @SUB_FOLDER placeholder if you did not set it manually. Again, remember this check is done on every page request.] As check_subfolder() already includes constants.php, the subsequent include of constants.php in core.php throws the php notices of already defined constants.

Solution(s):
Either
change line 310 in app\Config\core.php from
include("constants.php");
to
include_once("constants.php");
Or
remove the subfolder check from production by commenting out line 174 in app\Config\install.php by changing
  check_subfolder();
to
//disabledByCommunity  check_subfolder();

Regards
John


On Monday, 8 August 2016 18:50:43 UTC+2, gabriel2029 wrote:
Hi! I have the problem that PHP is always throing errors like
[Mon Aug 08 10:57:11.497921 2016] [:error] [pid 15883] [client 162.158.91.224:56798] PHP Notice:  Constant EMAIL_DELIVERY already defined in /var/www/html/orangescrum/app/Config/constants.php on line 12
...


in the apache error.log when interacting with the panel. Curiously, the website is working without any problems.

Justin Pilditch

unread,
Feb 23, 2018, 2:18:44 PM2/23/18
to Orangescrum Community Support
Top work there, John. include_once() worked a treat and repetitive errors stopped. Thank you.

Akanksha Parmar

unread,
Feb 24, 2018, 6:14:56 AM2/24/18
to Orangescrum Community Support
Hi John,

I followed the steps and still getting the http_home error after login.
Please suggest.

Best Regards
Akanksha

Max Meyer

unread,
May 7, 2023, 8:15:29 AM5/7/23
to Orangescrum Community Support
Hey, i have the same problem but in the bootstrap.php

[Sun May 07 13:53:39.430781 2023] [php7:notice] [pid 2330] [client ::1:65521] PHP Notice:  Constant CURRENT_FREE_PLAN already defined in /var/www/orangescrum/app/Config/bootstrap.php on line 86, referer: http://localhost:8004/
[Sun May 07 13:53:39.430851 2023] [php7:notice] [pid 2330] [client ::1:65521] PHP Notice:  Constant CURRENT_EXPIRED_PLAN already defined in /var/www/orangescrum/app/Config/bootstrap.php on line 87, referer: http://localhost:8004/
[Sun May 07 13:53:39.430902 2023] [php7:notice] [pid 2330] [client ::1:65521] PHP Notice:  Constant UPGRADE_PLAN already defined in /var/www/orangescrum/app/Config/bootstrap.php on line 88, referer: http://localhost:8004/
[Sun May 07 13:53:39.430955 2023] [php7:notice] [pid 2330] [client ::1:65521] PHP Notice:  Constant FREE_TRIAL_PERIOD already defined in /var/www/orangescrum/app/Config/bootstrap.php on line 90, referer: http://localhost:8004/
[Sun May 07 13:53:39.431025 2023] [php7:notice] [pid 2330] [client ::1:65521] PHP Notice:  Constant HTTP_FILES already defined in /var/www/orangescrum/app/Config/bootstrap.php on line 172, referer: http://localhost:8004/

i have a loop every time i start this page. my  error.log ist full of these error mesage and iam running out of ideas to fix...

Reply all
Reply to author
Forward
0 new messages