Moving a CakePHP 1.3.2 Application to a New Server

330 views Asked by At

I have a very old CakePHP 1.3.2 application that used to work on a server under a given domain. I have the original files and now I'm trying to set it up and get it running on a new server under a different domain.

At first I had to fix the following line in the webroot/index.php:

define('CAKE_CORE_INCLUDE_PATH', '/home/SOME_NAME/cakephp-1.3.2');

as the application could not even find the framework. It does find it now but I'm getting a 404 Page Not Found error. I'm completely clueless what is causing it and I even can't determine if the database connection is successful using the new user/pass/host parameters. The only indication of something going on is the following log file that I found on the server and it gets populated with the following lines every time I try to access the application through the browser:

2015-06-09 10:00:24 Warning: Warning (512): /home/SOME_NAME/public_html/OLD_DOMAIN_NAME/tmp/cache/ is not writable in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/cache/file.php, line 267]
2015-06-09 10:00:24 Warning: Warning (2): Invalid argument supplied for foreach() in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo/dbo_mysql.php, line 127]
2015-06-09 10:00:24 Warning: Warning (2): array_keys() expects parameter 1 to be array, boolean given in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo_source.php, line 1936]
2015-06-09 10:00:24 Warning: Warning (2): Invalid argument supplied for foreach() in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo/dbo_mysql.php, line 127]
2015-06-09 10:00:24 Warning: Warning (2): array_keys() expects parameter 1 to be array, boolean given in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo_source.php, line 1949]
2015-06-09 10:00:24 Warning: Warning (2): array_filter() expects parameter 1 to be array, null given in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo_source.php, line 1953]
2015-06-09 10:00:24 Warning: Warning (2): array_values() expects parameter 1 to be array, null given in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo_source.php, line 1953]
2015-06-09 10:00:24 Warning: Warning (2): array_unique() expects parameter 1 to be array, null given in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo_source.php, line 2045]
2015-06-09 10:00:24 Warning: Warning (2): Invalid argument supplied for foreach() in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo/dbo_mysql.php, line 127]
2015-06-09 10:00:24 Warning: Warning (2): array_keys() expects parameter 1 to be array, boolean given in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo_source.php, line 1936]
2015-06-09 10:00:24 Warning: Warning (2): Invalid argument supplied for foreach() in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo/dbo_mysql.php, line 127]
2015-06-09 10:00:24 Warning: Warning (2): array_keys() expects parameter 1 to be array, boolean given in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo_source.php, line 1949]
2015-06-09 10:00:24 Warning: Warning (2): array_filter() expects parameter 1 to be array, null given in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo_source.php, line 1953]
2015-06-09 10:00:24 Warning: Warning (2): array_values() expects parameter 1 to be array, null given in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo_source.php, line 1953]
2015-06-09 10:00:24 Warning: Warning (2): array_unique() expects parameter 1 to be array, null given in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo_source.php, line 2045]
2015-06-09 10:00:24 Warning: Warning (2): array_unique() expects parameter 1 to be array, null given in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo_source.php, line 1229]
2015-06-09 10:00:24 Warning: Warning (2): Invalid argument supplied for foreach() in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo/dbo_mysql.php, line 127]
2015-06-09 10:00:24 Warning: Warning (2): Invalid argument supplied for foreach() in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo/dbo_mysql.php, line 127]
2015-06-09 10:00:24 Warning: Warning (2): implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo_source.php, line 1448]
2015-06-09 10:00:24 Warning: Warning (2): Invalid argument supplied for foreach() in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo/dbo_mysql.php, line 127]
2015-06-09 10:00:24 Warning: Warning (2): array_keys() expects parameter 1 to be array, boolean given in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo_source.php, line 1936]
2015-06-09 10:00:24 Warning: Warning (2): Invalid argument supplied for foreach() in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo/dbo_mysql.php, line 127]
2015-06-09 10:00:24 Warning: Warning (2): Invalid argument supplied for foreach() in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo/dbo_mysql.php, line 127]
2015-06-09 10:00:24 Warning: Warning (2): Invalid argument supplied for foreach() in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo/dbo_mysql.php, line 127]
2015-06-09 10:00:24 Warning: Warning (2): Invalid argument supplied for foreach() in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo/dbo_mysql.php, line 127]
2015-06-09 10:00:24 Warning: Warning (2): Invalid argument supplied for foreach() in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo/dbo_mysql.php, line 127]
2015-06-09 10:00:24 Warning: Warning (2): Invalid argument supplied for foreach() in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo/dbo_mysql.php, line 127]
2015-06-09 10:00:24 Warning: Warning (2): Invalid argument supplied for foreach() in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo/dbo_mysql.php, line 127]
2015-06-09 10:00:24 Warning: Warning (2): Invalid argument supplied for foreach() in [/home/SOME_NAME/cakephp-1.3.2/cake/libs/model/datasources/dbo/dbo_mysql.php, line 127]

Any suggestions on how to proceed from here to narrow down the error to something more specific?

2

There are 2 answers

7
drmonkeyninja On BEST ANSWER

Your first error is because /home/SOME_NAME/public_html/OLD_DOMAIN_NAME/tmp/cache/ is not writeable. Make sure that tmp has the correct file permissions; it needs to be writeable by the web server user.

Otherwise your issue appears to be that the database config is wrong so the app cannot connect to the database. Check app/config/database.php and make sure the database is setup correctly and make sure that bootstrap.php isn't altering the connection (perhaps dependent on the server the app is installed).

You can check which database settings are being used in your code using:-

Configure::read('Session.database');

Test this near one of your errors.

If you can clear up those two issues you should be good.

3
Mike Stratton On

You have your work cut out for you. For starters, I would create a phpinfo to see the configuration differences between the old and new servers.

<?php

// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);

?>   

phpinfo