Cakephp App class code printing on the page and spl_autoload_register error - cakephp

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?

Related

Fatal error when updating joomla from 3.1.1 to 3.2.2

I updated my joomla site from 3.1.1 to 3.2.2 but now when I view my site I get
Fatal error: Call to a member function get() on a non-object in /home/studentw/public_html/plugins/system/remember/remember.php on line 96
I tried restoring my directory from a back up but I am still getting the error above. Line 96 of the remember.php file is:
$this->cookie_domain = $this->app->get('cookie_domain', '');
How can I fix this?
Google is your friend:
Rename your file remember.php to rememberBAK.php so it looks like this
/plugins/system/remember/rememberBAK.php
Find a copy of Joomla 3.1.15 and make a copy of the remember.php.
FTP the file to your folder
/plugins/system/remember/remember.php.
Now access your admin panel:
Go to Extensions -> Extension Manage -> Database.
Click Fix.
Now go to ftp, delete the remember.php that you uploaded and rename the original one to it's correct state.
Joomla updates do not update the database and this needs to be done manually.
For not developers, the above method is the simplest and quickest way
Source:Upgrade from 3.1 to 3.2 Fatal Error in Administrator Page

Varnish configuration not working

I have been installed varnish module in drupal 7 while clicking on configure it shows an error page with title server error and if i come back to module menu there was another error log
like Warning: require_once(/var/www/magz/sites/all/modules/varnish/varnish.admin.inc): failed to open stream: No such file or directory in menu_execute_active_handler() (line 515 of /var/www/magz/includes/menu.inc).
I tried reinstalling and some other stuffs but the error is still there is there any solution for this
Did you checked if the path and file (folder) is valid? seems that the module requires certain file which are not there.
I've checked with version: 7.x-1.0-beta2 and no such issue occurred.
Just to close out that the read permissions would cause this, please follow the instruction from that: page - regarding access rights setting.

CakePHP 2.x: Missing Plugin Exception while installing on shared host

I have been having an issue that has been driving me nuts all day.
I have a cakePhp site working with no problems on my local machine, another developers local machine and a dedicated server (for the production environment). I copied the development installation to a shared host (justhost.com). When I copied the site over (using rsync) to the shared host, I receive the following error:
Fatal error: Uncaught exception 'MissingPluginException' with message 'Plugin TinyMce could not be found.' in /home4/ncreport/public_html/mars/lib/Cake/Core/CakePlugin.php:97 Stack trace: #0 /home4/ncreport/public_html/mars/app/Config/bootstrap.php(71): CakePlugin::load('TinyMce') #1 /home4/ncreport/public_html/mars/lib/Cake/Core/Configure.php(81): include('/home4/ncreport...') #2 /home4/ncreport/public_html/mars/lib/Cake/bootstrap.php(138): Configure::bootstrap(true) #3 /home4/ncreport/public_html/mars/app/webroot/index.php(77): include('/home4/ncreport...') #4 {main} thrown in /home4/ncreport/public_html/mars/lib/Cake/Core/CakePlugin.php on line 97
<
I have tried multiple things found in google searches to remedy the problem. No luck. I have tried to change the .htaccess file to add a rewrite base, tried to specify the fully qualified plugin path in the bootstrap file, tried to delete everything and reinstall the entire app, tried to change the document root to several different values, tried everything I could think of.... It appears to be an issue with the shared host, but I am unable to determine the cause.
Any suggestions or recommendations?
I figured it out -- it turns out that on the current installation the names for the plugins is case sensitive. The installation where this was copied from does not have case sensitivity.
Corrected the case on the load statement and everything worked well.

Joomla database connection infinite loop

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.

cakephp elements MissingViewException

When I upload my cakePHP 2.0.0 app to my host I get a MissingViewException when I am calling an function via ajax. This returns an json object made by an element. On my local xampp everything is working fine, but when I upload it to my host, bytebob.com, I get the exception.
I have tried to make changes to my .htaccess like described in the advanced CakePHP installation page, but it doesn't change anything.
Here is the error log:
2011-10-25 18:26:04 Error: [MissingViewException] View file "/jalmar/app/View/elements/json.ctp" is missing.
0 /home/sites/jayar.dk/public_html/jalmar/lib/Cake/View/View.php(363): View->_getViewFileName('/elements/json')
1 /home/sites/jayar.dk/public_html/jalmar/lib/Cake/Controller/Controller.php(898): View->render('/elements/json', NULL)
2 /home/sites/jayar.dk/public_html/jalmar/app/Controller/AppController.php(22): Controller->render('/elements/json')
3 /home/sites/jayar.dk/public_html/jalmar/app/Controller/TilmeldingsController.php(147): AppController->sendJson(Array, Array)
4 [internal function]: TilmeldingsController->check_glogon()
The host is running php as a CGI, but I don't think that is the reason...
As I wrote in the comments, the error was that I had written the path to elements with a lowercase e in my AppController. This worked on my localhost as a windows, but not in my host using unix... Thought I had tried to change it but apperently not.
As this is my first question on stack overflow, so is okay that I accept my own answer to close the question?

Resources