Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 10th Apr 2015, 04:24 PM   #1
Active Warrior
 
Join Date: 2010
Posts: 58
Thanks: 2
Thanked 1 Time in 1 Post
Default
[Whats make this error] PHP Notice: Use of undefined constant
Share on: 
fb share twitter share gplus share more share

I just moved to new host
In this new host i always got error_log, even with this simple php file :
PHP Code:
<?php define(Y,120); ?>
this is the error_log content:
[09-Apr-2015 18:42:09 UTC] PHP Notice: Use of undefined constant Y - assumed 'Y' in /home/username/public_html/test.php on line 1

i can add single quote wrapping the Y like this to fix it
PHP Code:
<?php define('Y',120); ?>
but there are a lot of code like that, it is better if i dont need to change the files,
but just change the hosting required, what is it actually? is it because using litespeed?

in old hosting there is cgi-fcgi information


in new hosting is using litespeed

I like forum
basketmen is offline  
Unread 10th Apr 2015, 05:20 PM   #2
Advanced Warrior
War Room Member
 
Janet Sawyer's Avatar
 
Join Date: 2003
Location: United Kingdom.
Posts: 737
Thanks: 107
Thanked 208 Times in 159 Posts
Default
Re: [Whats make this error] PHP Notice: Use of undefined constant
Share on: 
fb share twitter share gplus share more share

Let me google that for you

Janet Sawyer is offline  
Unread 10th Apr 2015, 05:36 PM   #3
HyperActive Warrior
War Room Member
 
emptee's Avatar
 
Join Date: 2014
Location: New Zealand
Posts: 210
Thanks: 25
Thanked 81 Times in 71 Posts
Default
Re: [Whats make this error] PHP Notice: Use of undefined constant
Share on: 
fb share twitter share gplus share more share

The first parameter of define needs to be a string - the error is complaining about you trying to use Y (the constant) before it is defined..

Use a half decent text editor (notepad++ comes to mind) and search in all files/folders/etc. for regex 'define\([^']*[A-Za-z]' untested, might need messing with depending on your tool..

Cheers,
Michael

emptee is offline  
Closed Thread


Bookmarks

Tags
constant, error, make, notice, php, undefined


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 10:53 AM.