• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

Is it possible to have variable or something with out $ symbol ?

I have cakephp application working fine through browser etc., but when I run cron way calling some controller (cron) , I get the below error on this line,

error line -> DEBUG=3;
return $config['Cake.version'] = '2.0.0-dev';

2 ->PHP Parse error:  syntax error, unexpected '=' in /var/www/xxxx/core/cake/config/config.php on line 19

"DEBUG " is it constant or variable ?
0
Loganathan Natarajan
Asked:
Loganathan Natarajan
  • 2
  • 2
  • 2
  • +3
6 Solutions
 
Michel PlungjanIT ExpertCommented:
Show the code. It does not look correct
In php you have VARs with $ but not FUNCTIONs with $
so
$somevar = config($someparm);
0
 
Loganathan NatarajanLAMP DeveloperAuthor Commented:
thanks, check the attachment.full code
0
 
Jagadishwor DulalBraces MediaCommented:
It may be the constant value written in the  config Like below:
Configure::write('debug', 3);

Open in new window

0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
Dave BaldwinFixer of ProblemsCommented:
If that's in the 'configure.php' file, yours does not match what I just downloaded.  If this is a new installation, you should look at getting a newer version of CakePHP.  https://github.com/cakephp/cakephp/tags
0
 
Michel PlungjanIT ExpertCommented:
Here is an example of a core configuration file

https://github.com/cakephp/cakephp/blob/master/app/Config/core.php

There is no way your statement would work in PHP regardless of framework in my opinion
0
 
Dave BaldwinFixer of ProblemsCommented:
I agree with @mplungjan, I don't see how it would ever work.
0
 
Jagadishwor DulalBraces MediaCommented:
Better one to reinstall the cakephp framework
0
 
Loganathan NatarajanLAMP DeveloperAuthor Commented:
Thanks to all, let me check & back.
0
 
hieloCommented:
>>or something with out $ symbol ?
In PHP, variables have the '$' prefix, but constants do not.  So, to set DEBUG to 3 (without the '$') you would need to use define():

<?php
define('DEBUG',3);//After this line DEBUG is a constant - you cannot reassign a value to it
echo DEBUG; //should show 3
?>

Open in new window

0
 
Ray PaseurCommented:
Agree with Dave -- reinstall Cake!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 2
  • 2
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now