CakePHP without mod_rewrite causes 404 errors - cakephp

I'm pretty new to Cake, so I tryed to start with the blog tutorial.
I installed CakePHP 2.3.8 in webroot.
Configured SQL and deleted all 3 .htaccess-files, cause i have no mod_rewrite. In core.php I activated
Configure::write('App.baseUrl', env('SCRIPT_NAME'));
I created the Posts-Model, Controller and the index-View like the tutorial says.
The APP/View/Pages/home.ctp tells me, everything's allright.
But when i try to open /posts/index i get a 404. Why?

Without mod_rewrite the urls look like www.example.com/index.php/controllername/actionname/param, i.e. in your example you have to call /index.php/posts/index (or /index.php/posts/).

Related

angular js path returns 404 error when https is used

Please keep in mind, I have not worked with angular JS, nor did I write the code that is causing the error.
I am getting an 404 error on this path:
https://www.helivalues.com/Su6UsWuf/bb/option/mfg/all
but not this path:
http://www.helivalues.com/Su6UsWuf/bb/option/mfg/all
It was noticed that when a user views a certain page in https, the drop down does not load options. Angular Js makes a call to the path mention above which is not an actually file but is used by a php file that based on this path, has a switch that fills in the drop down.
Any ideas on how to get the https version to work? This is on a joomla site and I do have access to the htaccess file if needed. I really just need it to work for a few months while I work on building a new site.
Thanks!
Angularjs is not the issue. Your webserver (Apache/2.2.15 (SuSE) Server at www.helivalues.com Port 443) states the file can not be found. So it looks like something is misconfigured with your apache site.

CakePHP "Object not found!" XAMP

I have downloaded and setup CakePHP on XAMP (Win 7) following by http://www.youtube.com/watch?v=hQos_O-nqtQ tutorial.
When I setup new project using NetBeans IDE 8.0.1, everything goes fine but when I tried to view page of my ItemsController's "index" function using http:// myproject/items/ it says: "Object not found!".
I tried "http:// myproject/index.php/items/" and my page loads without javascript and css files. I tried everything which are suggested here, but could not resolve the issue after spending many hours. Does anyone know the exact solution of this problem?
Thanks
The problem was solved from the link provided by Kai leonardaustin.com/blog/technical/enable-mod_rewrite-in-xampp. The problem solved after one change in httpd.conf file residing in xampp\apache\conf folder. Change: AllowOverride none to AllowOverride All.
#Kai: Thanks a lot.
I have to post my own answer as Kai did not post his reply as "Answer" even after a long time

Debug CakePhp Step by step

My client want the code I've did in a subfolder.
I've put everything inside but I have only a blank page.
When I try to use phpinfo in the index file, nothing appears.
On the app/core.php the same
I don't have access to root to test if it's an issue with the root .htaccess or with my script.
Which cakephp file should be called first if the subdomain setup is good?
Thanks.
EDIT:
Ok I know what's wrong. SetEnv PHP_VER 5_3 does not work on the shared
hosting where my client have his main website. The client does not
want to upgrade the php version and this directive in the .htaccess
seems to be ignored. What alternatives do I have ...?

URL rewriting is not properly configured on your server

I tried upgrading my cakephp version from 1.3 to 2.5 but encountered an url rewriting problem. Another cakephp app runs on the same version so I'm sure the mod_rewrite works.
Although when I go to example.com/pages/home I get following error:
URL rewriting is not properly configured on your server. 1) Help me configure it 2) I don't / can't use URL rewriting
When I go to my normal home page and I want to click on a home link I get following url :
http://example.com/app/webroot/index.php/
And it is the same for other urls.
http://example.com/antwerp becomes http://example.com/app/webroot/index.php/antwerp
When I go to http://example.com/antwerp the site works as it should...
Any ideas where I've gone wrong?
I would suggest accessing your account and re-uploading your .htaccess files from and to the following locations respectivelly.
/app
.htaccess
/webroot
.htaccess
.htaccess
Some FTPs do not upload those files automatically until you force it to.
If that does not work, check if you have your php.ini file in your public_html folder of this application.

CakePHP 1.3.0 RC4 Installation

I have been using 1.2.6 and downloaded 1.3 to try it out. I am using wampserver with Apache 2.2.11. I have mod rewrite enabled. When I bake a new application using the cake 1.3 console, after I verify that the webroot/index.php of the application CAKE_CORE_INCLUDE_PATH is set to the Cake1.3 Installation folder. The result is a page thats missing CSS, missing a method. Typing in localhost/app/index.php will enable the program to find the app. Therefore I have to assume the rewrite module isnt functioning properly for v1.3. Is there something I have to add to the cake installation or app folder to make this function as it should?
No, Cake is set up properly from the start. The thing that always trips me up is that I forget to set my Apache virtual host's AllowOverride value to All. This allows the .htaccess file to be read.
Are there any error messages in your apache error logs?
Did you replace the previous application's directory with the new one? If not, you may need to add a tag with the appropriate AllowOverride permissions set inside your httpd.conf file, to allow mod rewrite to execute.
Can you load /css/style.css in your browser or does it give a 404?
This may sound like a silly question, but after you made your changes to AllowOverride in your Apache configuration, did you restart Apache?

Resources