Jump to content
The Uniform Server Community

"Internal Server Error" using RewriteRule on CakePHP


Warringer
 Share

Recommended Posts

I'm currently trying to set up the Uniform Server as lightweight server for baking cakes (aka programming with CakePHP).

 

Since it uses beautified URLs, and mod_rewrite, I got a problem.

 

At first I got a 403 Error for the folder where I have placed Cake, but that was corrected using some Google-Fu and this forum and

Options +FollowSymLinks

 

Now I'm getting a 500 Error.

 

I tried following .htaccess:

 

Options +FollowSymLinks
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule	^$ app/webroot/	[L]
  RewriteRule	(.*) app/webroot/$1 [L]
</IfModule>

 

and

 

<IfModule mod_rewrite.c>
  RewriteEngine on
  Options +FollowSymLinks
  RewriteRule	^$ app/webroot/	[L]
  RewriteRule	(.*) app/webroot/$1 [L]
</IfModule>

 

Neither works.

 

For reference, I'm using vanilla Uniform Server 3.5 and Cake PHP 1.2.0.7296 RC2, currently on Vista.

Link to comment
Share on other sites

  • 1 month later...

Installing cake CakePHP 1.2.0.7296 RC2 on Uniform Server 3.5-Apollo

 

1) Start with a fresh copy of US 3.5

2) Start US wait for apanel.

3) From apanel click phpMyAdmin

4) In create new database type maincake (or whatever name you wish to use) click create.

5) Unzip cake_1.2.0.7296-rc2.zip to any folder.

6) Navigate to the last folder named cake_1.2.0.7296-rc2 copy this folder and all it’s contens to US folder www.

7) Once copied rename cake_1.2.0.7296-rc2 to cake

8) Inside folder \Uniform Server\udrive\www\cake edit file .htaccess to look like this:

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteRule	^$	webroot/	[L]
RewriteRule	(.*) webroot/$1	[L]
</IfModule>

9) Inside folder \Uniform Server\udrive\www\cake\app edit file .htaccess to look like this:

<IfModule mod_rewrite.c>
Options +FollowSymLinks  
RewriteEngine on
RewriteRule	^$	webroot/	[L]
RewriteRule	(.*) webroot/$1	[L]
</IfModule>

10) Inside folder \Uniform Server\udrive\www\cake\app\config edit file core.php

Locate the following line (line 153):

 

Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');

 

Change the character string to something different it must have the same number of characters e.g:

 

Configure::write('Security.salt', 'MYhG97b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');

 

11) Inside folder Uniform Server\udrive\www\cake\app\config rename the file database.php.default to database.php edit this file as follows.

 

At the bottom of this page locate the following code:

var $default = array(
 'driver' => 'mysql',
 'persistent' => false,
 'host' => 'localhost',
 'login' => 'user',
 'password' => 'password',
 'database' => 'database_name',
  'prefix' => '',
);

Change it to look like this:

var $default = array(
 'driver' => 'mysql',
 'persistent' => false,
 'host' => 'localhost',
 'login' => 'root',
 'password' => 'root',
 'database' => 'maincake',
  'prefix' => '',
);

Note 1: ‘login’ and ‘password’ are set to “root” Uniform Server’s default MySQL name and password.

 

Note 2: ‘database’ set this to the name you created in step 4

 

12) Check the set-up by typing http://localhost/cake/ into your browser address bar.

 

The following four lines are highlighted in green meaning you are ready to go.

a) Your tmp directory is writable.

:blink: The FileEngine is being used for caching. To change the config edit APP/config/core.php

c) Your database configuration file is present.

d) Cake is able to connect to the database.

 

All the best

Ric ;)

Link to comment
Share on other sites

  • 2 months later...

I get an internal server error after following this guide.

 

[Thu Dec 04 00:00:37 2008] [error] [client 127.0.0.1] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary., referer: http://localhost/

 

I've checked the instructions 10 times, everything seems correct.

 

Any suggestions?

 

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...