ERR_TOO_MANY_REDIRECTS after moving CakePHP project from a dedicated server to another dedicated server - cakephp

I'm new to CakePHP and my employer asked me to move our CakePHP app from a dedicated server to another server (for testing purposes). I've copied all the files, changed app's database.php config but I'm getting a ERR_TOO_MANY_REDIRECTS when accessing the app on the new server.
I did not work on the app so I don't know much about it, but I have all the files.
LE: So, I've uploaded the app on a fresh install of CakePHP. I now have 3 .htaccess files, CakePHP says it's working, but when I try to upload DebugKit (following the install notes & having the proper version for CakePHP 2.4.3.) I get the ERR_TOO_MANY_REDIRECTS.
A look in Chrome's console shows me this. If I delete the DebugKit altogether, the page looks like this & it also has the footer from the app.
The new structure of the app is the standard one.
Please advise!

Best guess is the (apache?) DocumentRoot setting may be clashing with your APP config on the new server and/or the PHP settings. Have you checked your php.ini on the new server? What's the output of phpinfo() ? Once fixed HIGHLY RECOMMEND check other environment variables by turning on the DEBUG flag in config/app.php For your version try pr(Debugger::trace()); or even better for dev. install the Debug kit. Anyway, DocumentRoot should be set to webroot (assuming default install and directory structure).

Related

How do I install phpmyadmin in Aegir?

In which folder should I put phpmyadmin folder in aegir system?
In a old project I remember an expert developer used to put the phpmyadmin folder under the folder /var/aegir/hostmaster and it worked (through the url panel.example.com/phpmyadmin).
I am now trying same thing but it doesn’t work. Should I modify some file or some setting to “read” the folder hostmaster? (I have tried to change permission but it didn’t help).
In this new server I am using Nginx.
In the old one (when everything was working) there was Apache.
It can be a problem of configuration of Nginx?
Thank you

GoogleAppEngine wordpress complains (Could not create directory) on update and plugin install

I have a problem updating wordpress or installing wordpress plugin in my local version of google app engine. I get the following message.
Downloading install package from
https://downloads.wordpress.org/plugin/event-espresso-decaf.4.8.38.decaf.zip…
Unpacking the package…
Could not create directory.
With the same code base I am able install plugin using MAMP (Macintosh, Apache, MySQL, and PHP). However fails with google Pyton script (dev_appserver.py).
I tried changing the permission of the file system by giving privilege to all user for write. Tried executing as sudo dev_appserver.py .. Followed the advice in other post, No luck.
Whats the problem here?, With MAMP all looks good in my local, but the same code break as I deploy to GAE (​appcfg.py -A APP-ID update app.yaml). Whats the problem here
Cannot write to file on Google App Engine Dev server with PHP?
Staring SDK 1.9.18, dev_appserver disables local file writing by default to better simulate the production environment. You can enable file writing by adding "google_app_engine.disable_readonly_filesystem=1" to your php.ini file.
I also wrote a blog post about running WordPress on App Engine flexible environment at:
https://wp.gaeflex.ninja/2016/03/25/using-wordpress-multisite/
Please give it a try too.

CakePHP with Homestead

I'm trying to do some cakePHP development using my existing homestead
installation I use for Laravel.
I can get the application running but it says that
'URL rewriting is not properly configured on your server.'
I tried to use the instructions to configure nginx but did not have much luck.
Has anyone gotten url rewriting to work, or can point me at any sources?
I know their is a vagrant setup for cakephp, but I'd rather continue to use homestead if possible.
SSH into your Homestead VM.
Edit /etc/nginx/sites-available/your-site.app and add /webroot to the line that looks like: root "/home/vagrant/your-site"; so that it looks like root "/home/vagrant/your-site/webroot";
Restart nginx with: sudo service nginx restart
Your should find your CakePHP pages can find their static content.
I don't know much about homestead, other than it is a vagrant box. I would suggest using a box that was tailored for cakephp:
https://github.com/FriendsOfCake/vagrant-chef
This is an article on how to get that set up correctly:
http://josediazgonzalez.com/2014/12/02/designing-a-store-application-in-cakephp/

Pycharm Run server error no app.yaml file at '.' for google app engine project

I'm pretty new with Pycharm and since this morning i have tried different configuration to use the Run command with an existing Google app engine project but without success.
I have a pretty clear error :)
google.appengine.tools.devappserver2.errors.AppConfigNotFoundError: no app.yaml file at '.'
Nothing wrong with that because the existing project use a custom file call app_dev.yaml. So it's normal that Pycharm is unable to load the server.
How can i change this behaviour and tell Pycharm to use app_dev.yaml instead of app.yaml?
Is it possible?
Thanks
I input an app.yaml on root directory and reloading my project, this working for me.
While the PY-9714 issue was, indeed, closed without a resolution, the automatic '.' added to the Run configuration has been reconsidered in PY-10675 in light of GAE support for multiple modules/services inside the same application and/or request routing using a dispatch.yaml file.
So in the more recent PyCharm versions it's possible to specify one or more .yaml files as options in the Run configuration. See for an example Pycharm multiple modules Run server
For those still running an older Pycharm version without the fix, a solution using a wrapper script is described in Run App Engine development server with modules in PyCharm

cakephp 2.1 migration cache error

I'm trying to migrate my app from cakephp 2.0 to 2.1. I've been using 2.1 for a couple of weeks on my local development server, and everything works fine. I've just tried uploading to the production server, and I'm getting the error message:
Fatal error: Class 'Cache' not found in app/Config/core.php on line 265
I'm probably missing something obvious, but I can't work out what. If anyone has experienced something similar or can offer any suggestions I'd be very grateful!
(I'm using the CakePHP 2.1.0 stable release)
Are you very sure you uploaded all the "core" files (the lib directory)? It seems the Cache class is missing, which is a core class of CakePHP. The error message is indicating an incomplete CakePHP install on your server.
Verify if the file lib/Cake/Cache/Cache.php exists and is readable by the webserver you are using (e.g. ownership is set to apache.apache or www-data.www-data and chmod is set properly. If using SELinux, also make sure the files have httpd_sys_content_t or public_content_rw_t context set).

Resources