Getting 500 Internal Server Error when trying to run PHP application of yii in Browser?

StackOverflow https://stackoverflow.com/questions/21845546

  •  13-10-2022
  •  | 
  •  

Question

I am newbie in Php as this question has already been asked several times.... I have import php project in netbeans and db as well in sqlyog but when i am trying to run that app i am getting error in browser Here is the error : Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log.

Have changed these two lines of index.php **

<?php
// change the following paths if necessary
$yii=dirname('C://wamp/www/yii-1.1.8.r3324/framework/yii.php').'/../yii-1.1.8.r3324/framework/yii.php';
$config=dirname('C://wamp/www/examapp/protected/config/main.php').'/protected/config/main.php';
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
require_once($yii);
Yii::createWebApplication($config)->run();

as per my path i have added here is it right?

// change the following paths if necessary
$yii=dirname('C://wamp/www/yii-1.1.8.r3324/framework/yii.php').'/../yii-1.1.8.r3324/framework/yii.php';
$config=dirname('C://wamp/www/examapp/protected/config/main.php').'/protected/config/main.php';

Error Reporting:

File does not exist: C:/wamp/www/favicon.ico [Tue Feb 18 11:07:41 2014] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/favicon.ico [Tue Feb 18 11:09:44 2014] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/wamp [Tue Feb 18 11:09:52 2014] [alert] [client 127.0.0.1] C:/wamp/www/examapp/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration [Tue Feb 18 11:10:04 2014] [alert] [client 127.0.0.1] C:/wamp/www/examapp/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration [Tue Feb 18 11:15:48 2014] [alert] [client 127.0.0.1] C:/wamp/www/examapp/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration [Tue Feb 18 11:15:50 2014] [alert] [client 127.0.0.1] C:/wamp/www/examapp/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration [Tue Feb 18 11:16:47 2014] [alert] [client 127.0.0.1] C:/wamp/www/examapp/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration [Tue Feb 18 11:16:48 2014] [alert] [client 127.0.0.1] C:/wamp/www/examapp/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration [Tue Feb 18 11:16:51 2014] [alert] [client 127.0.0.1] C:/wamp/www/examapp/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration [Tue Feb 18 11:18:50 2014] [alert] [client 127.0.0.1] C:/wamp/www/examapp/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration [Tue Feb 18 11:20:03 2014] [alert] [client 127.0.0.1] C:/wamp/www/examapp/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration [Tue Feb 18 11:23:26 2014] [alert] [client 127.0.0.1] C:/wamp/www/examapp/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration [Tue Feb 18 11:24:32 2014] [alert] [client 127.0.0.1] C:/wamp/www/examapp/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration [Tue Feb 18 11:26:41 2014] [alert] [client 127.0.0.1] C:/wamp/www/examapp/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration [Tue Feb 18 11:27:26 2014] [alert] [client 127.0.0.1] C:/wamp/www/examapp/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration [Tue Feb 18 11:27:27 2014] [alert] [client 127.0.0.1] C:/wamp/www/examapp/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration [Tue Feb 18 11:31:20 2014] [alert] [client 127.0.0.1] C:/wamp/www/examapp/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

No correct solution

OTHER TIPS

I guess you just need to specify absolute path for yii.php and main.php files.

So I think following lines should work fine.

$yii='C://wamp/www/yii-1.1.8.r3324/framework/yii.php';
$config='C://wamp/www/examapp/protected/config/main.php';

Also you can use dirname(__FILE__) to get the current directory and set the path to files relatively from that directory, which would be better solution.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top