Error 500 after deployment (Auth Component)

Hi,

I’ve built my website with Cake 3.X with Wamp, and it works fine.
I want to deploy it on a free server (hostinger), just to show it to the future owner. But, once online, only the pages without Auth Component are functional : users/login and users/add.
The others don’t work, there is a 500 error, and I don’t understand it.

My htaccess :

RewriteEngine on
RewriteBase /
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]

Could you help me, please ?

Thanks a lot :slight_smile:

Hi @clem917, can you send your log file of the remote server ?

There are problems with CSS and Font Awesome in Cake PHP logs, but impossible to see server logs … :confused:

2016-09-11 18:59:02 Error: [Cake\Routing\Exception\MissingControllerException] Controller class Favicon.ico could not be found.
Exception Attributes: array (
  'class' => 'Favicon.ico',
  'plugin' => NULL,
  'prefix' => NULL,
  '_ext' => NULL,
)
Request URL: /favicon.ico
Stack Trace:
#0 /home/u329991205/public_html/webroot/index.php(36): Cake\Routing\Dispatcher-     >dispatch(Object(Cake\Network\Request), Object(Cake\Network\Response))
#1 {main}


2016-09-11 18:59:29 Error: [Cake\Routing\Exception\MissingControllerException] Controller class Js could not be     found.
Exception Attributes: array (
  'class' => 'Js',
  'plugin' => NULL,
  'prefix' => NULL,
  '_ext' => NULL,
)
Request URL: /js/datatables.net-scroller/js/datatables.scroller.min.js
Stack Trace:
#0 /home/u329991205/public_html/webroot/index.php(36): Cake\Routing\Dispatcher-    >dispatch(Object(Cake\Network\Request), Object(Cake\Network\Response))
#1 {main}


2016-09-11 18:59:30 Error: [Cake\Routing\Exception\MissingControllerException] Controller class Css could not be   found.
Exception Attributes: array (
   'class' => 'Css',
  'plugin' => NULL,
  'prefix' => NULL,
  '_ext' => NULL,
)
 Request URL: /css/plugins/font-awesome/fonts/fontawesome-webfont.woff2?v=4.6.3
Stack Trace:
#0 /home/u329991205/public_html/webroot/index.php(36): Cake\Routing\Dispatcher- >dispatch(Object(Cake\Network\Request), Object(Cake\Network\Response))
#1 {main}


2016-09-11 18:59:31 Error: [Cake\Routing\Exception\MissingControllerException] Controller class Css could not be     found.
Exception Attributes: array (
  'class' => 'Css',
  'plugin' => NULL,
  'prefix' => NULL,
  '_ext' => NULL,
)
Request URL: /css/plugins/font-awesome/fonts/fontawesome-webfont.woff?v=4.6.3
Stack Trace:
#0 /home/u329991205/public_html/webroot/index.php(36): Cake\Routing\Dispatcher->dispatch(Object(Cake\Network\Request), Object(Cake\Network\Response))
#1 {main}


2016-09-11 18:59:31 Error: [Cake\Routing\Exception\MissingControllerException] Controller class Css could not be found.
Exception Attributes: array (
  'class' => 'Css',
  'plugin' => NULL,
   'prefix' => NULL,
 '_ext' => NULL,
 )
Request URL: /css/plugins/font-awesome/fonts/fontawesome-webfont.ttf?v=4.6.3
Stack Trace:
#0 /home/u329991205/public_html/webroot/index.php(36): Cake\Routing\Dispatcher->dispatch(Object(Cake\Network\Request), Object(Cake\Network\Response))
#1 {main}

On your free hosting service “hostinger” you have a SSH account ? For do a “composer install” in project folder. :slight_smile:

I don’t have SSH. But I’ve installed Cake with the autoinstaller on hostinger, and without my files there wasn’t any problem :confused:

Hello there,
i have a similar problem with cakephp amd hostinger…i am using cakephp version 3.x…its works fine on my local machine bt it throws server internal error on some pages…my controller and view code is given below

UsersController.php

pubic function register(){
$render = [];
$user = $this->Users->newEntity();
$render[‘user’]=$user;
$this->set($render);
}

users/register.ctp

echo $this->Form->create($user);


echo $this->Form->end();

The above code runs fine in my local machine bt gives internal server error in hostinger.
Moreover, if i remove $user from create() method

$this->Form->create();

it works in hostinger bt it does not show the validation messages

I wonder whether it is related to auth or database configuration or may be an entity class issue

Note: Authentication is implemented in my project

I hope someone will figure it out
Thank you

If an app is running fine on local but not on the remote server, there are a couple of common reasons:

  • you copied the tmp folder from local to remote; This usually causes errors, especially files in cache/models dir

  • some files didn’t get uploaded properly possibly due to connection errors

  • sometimes different php versions and php.ini settings (mod_rewrite, short_open_tag, memory_limit, etc.) can cause weird errors to appear

You should always at least make sure to rule out these. There are probably many more uncommon ones, though :slight_smile:

Hello,
thanks for your suggestions.But i installed cakephp 3 on hostinger using there installer.it worked but thn i replaced the model view and controller folder from my local machine. It still gives dat 500 internal server error whenever i try to access the form i mentioned in my earlier rply.

Remember free hosting isn’t that great.

I just checked out http://www.hostinger.com/web-hosting I saw no free hosting plans.