I have hired a developer to fix some bugs on my site built on CakePHP framework, but when uploaded the changes he made i got an error:
"Parse error: syntax error, unexpected T_STRING in...."
The strange thing is that the file works OK on the demo, but when try to upload file to the main site the error appears. Can you please have a look at the code and tell me where is that error. Here is the uploaded file: http://textuploader.com/xhok
line 41 $this->ListingProperty->initialize(&$controller);
uses call time pass-by-reference removed in php 5.4
line 49 $this->CommonFunctions->initialize($controller);
has the same issue
see PHP 5.4 Call-time pass-by-reference - Easy fix available?
otherwise the file has no syntactic problems on php 5.5
>php -l a.php
No syntax errors detected in a.php
I managed to fix this issue.The problem was in the FTP program (Filezilla). Forsome reason Filezilla was uploading the files as ASCII and that makes a huge error in some PHP files. I have fixed the issue by changing the upload method as Binary. Here is how to change it:
Edit > Settings > Transfers > File Types > select Binary
Related
Ive been working on get a proxy working for when im school, to access sites that i use alot for work but my school dont like.. This is the error it comes up with when i try to upload the files to googles app engine..
C:\Program Files (x86)\Google\google_appengine>"C:\Python27\python.exe" appcfg.p
y update C:\Users\alastair\Desktop\School Files\Proxy Files\mirrorrr-master\mirrorrr-master
09:44 PM Host: appengine.google.com
Usage: appcfg.py [options] update | [file, ...]
appcfg.py: error: Directory does not contain an School.yaml configuration file
So im very confused on why it is asking for a "School.yaml" But i made one anyway, And even though its been made, it still displays this error, So if anyone can help, Please!
Your full project path contains two space characters and needs to be quoted, also, a trailing slash might be required i.e.:
C:\Python27\python.exe appcfg.py update "C:\Users\alastair\Desktop\School Files\Proxy Files\mirrorrr-master\mirrorrr-master\" assuming that's where you have your app.yaml file.
In your case it's thinking you are pointing to "C:\Users\alastair\Desktop\School" file which does not exist and thus showing the error.
I am getting an error when I uploaded the files online. Something is suddenly up with the debugkit.
Parse error: syntax error, unexpected T_FUNCTION in
/home3/beauface/public_html/cosmeticsurgeryph/inventory/app/Plugin/DebugKit/Controller/Component/ToolbarComponent.php
on line 179
Everything is working smoothly when I run it on localhost.
Please enlighten me :(
Change your PHP Version to 5.3 or greater.
Because ToolbarComponent.php uses Anonymous Functions which supports only from 5.3+
I am using cakephp-2.4.4 When I have backed my project in console this giving me below error
myphp version :5.4.12
If any body face this types of problem.Please help me to solve it.
I can ensure there is no any problem in environment variable.I have checked.
Bake is run in Console directory.Try in app/Console
Call Console cake
In the early days it was recommended to put cake in your path so you could type cake anywhere. Eventually this was realised to be a bad idea, it's not the recomended way to do things any more instead use the executable that's in your application:
> cd my\app
> Console\cake
Welcome to CakePHP v2.x.x Console
---------------------------------...
Read the error message
If using the correct executable doesn't immediately fix the problem - read the error message. It's not possible to say more as the image in the question truncates the output, however it contains:
<title>... Errors</title>
This in an indication that the output is a cakephp error i.e. the html you're seeing is the result of a fatal error of some kind (e.g. a missing plugin, model or other class).
Read the error message (or open app\tmp\error.log and read it there), address the problem and Console\cake will work as expected.
I have moved the CakePHP installation from my development server to production server (Config file and htaccess updated).
The production server was using an older version of PHP and I have requested the host to upgrade it. After they upgraded the PHP version, the site printing the php code on the webpage (Class : /lib/Cake/core/app) .. Also it displaying a fatal error on the bottom of the page, its below
Fatal error: Uncaught exception 'LogicException' with message 'Passed
array does not specify an existing static method (class 'App' not
found)' in /xxxxxxx/lib/Cake/bootstrap.php:154 Stack trace: #0
/xxxxxxx/lib/Cake/bootstrap.php(154): spl_autoload_register(Array) #1
/xxxxxxx/app/webroot/index.php(92): include('/xxxxxxx/pu...') #2
{main} thrown in /xxxxxxx/lib/Cake/bootstrap.php on line 154
Please help..
Have you checked the PHP version has actually changed, did you check (with phpinfo())?
Apparently, CakePHP was unable to find or load the App class (/xxxx/lib/Cake/core/App.php).
It's possible that paths have changed since the update, however, (if you're using CakePHP 2.3.1) line 134 of that same file uses this to load that file:
require CAKE . 'Core' . DS . 'App.php';
If the file was not present or could not be loaded, the script should stop at that point.
To check if your paths are correct, try to debug that path;
echo CAKE . 'Core' . DS . 'App.php'; die();
If that path is correct (my guess it is, otherwise the require should have stopped the script already as mentioned above), there is something wrong with the content of the App.php file. Maybe something corrupted the file (partial upload?) or incorrect line-endings caused PHP to interpret it incorrectly.
If the page is really showing the complete source of the App class, it may be possible you're (inadvertendly) using php 'short opening tags' and this has been disabled in the new configuration <? which may be cause, for example if a space is there is a space after the <? - <? PHP
More on short opening tags can be found here:
Are PHP short tags acceptable to use?
My Joomla site located on first machine and a database on second.
I updated the configuration.php parameters $host, $user, $password and$db
But I got error saying an infinite loop has been detected.
I'm running Joomla version: 1.7.3 stable.
What's wrong?
Chances are it is a php error in your configuration.php file - possibly your password includes a quote or some other character than breaks the PHP - introducing a syntax error.
As a quick test - you could create a .php file (perhaps test.php) that includes 'configuration.php'. Load your test.php file and see if you get an error.
Alternatively - inspect your configuration.php file manually to spot the error. If you edited it manually you may have deleted a semi-colon for example.
Hope that helps.