Neeraj Rathod Neeraj Rathod - 1 year ago 169
PHP Question

How to run php file in webroot of cakephp project

I want to run php file which is placed in webroot folder of cakephp 2.5 project.
while running that i am getting error given below
enter image description here

Here nghome is the folder which is placed in webroot of the project and i want to execute a database.php file which is in webroot/nghome/database.php but while executing that file i am getting error where it says nghome controller is not found.

any help or suggestion will be appreciated , thanks in advance

Answer Source

I finally got this working by updating .htaccess file under webroot folder with below code

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download