“CAssetManager.basePath”/ Applications / XAMPP / xamppfiles / htdocs / instastrm / assets“无效”

I downloaded this GitHub project. But when I put it in my XAMPP and run it, at first it shows a error like this:

Warning: require_once(/Applications/XAMPP/xamppfiles/htdocs/instastrm/../framework/yii.php): failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/instastrm/index.php on line 13

Fatal error: require_once(): Failed opening required '/Applications/XAMPP/xamppfiles/htdocs/instastrm/../framework/yii.php' (include_path='.:/Applications/XAMPP/xamppfiles/lib/php') in /Applications/XAMPP/xamppfiles/htdocs/instastrm/index.php on line 13

I fixed it by downloading yii framework 1.1.16 and putting the framework folder into the root directory of the app and tweaking the file location in index.php. The above error vanished but a new one took its place but since I am new to Yii I don't know how to address the below error.

CException

CAssetManager.basePath "/Applications/XAMPP/xamppfiles/htdocs/instastrm/assets" is invalid. Please make sure the directory exists and is writable by the Web server process.

Download the project you're installing from here. Download Yii 1.1.16 from here.

  • Extract the project folder inside /var/www folder, your folder structure should look like /var/www/instastrm-master/, you can rename this if you want.
  • Now, extract the yii-1.1.16.bca042.tar.gz that you downloaded earlier and copy framework folder and paste it inside /var/www/instastrm-master/.
  • Modify your index.php file, which you will find in /var/www/instastrm-master/index.php and change the line:

    $yii=dirname(__FILE__).'/../framework/yii.php';

    to

    $yii=dirname(__FILE__).'/framework/yii.php';

  • Create an assets folder inside /var/www/instastrm-master/, and give the entire folder read write permission (777).

  • Create another folder inside /var/www/instastrm-master/protected/ called runtime and give it the read write permission too.
  • Try executing the application, http://localhost/instastrm-master, it should work.

Edit:

After looking at your comments on Error 500 CDbConnection failed to open the DB connection., this error means the applcation cannot connect to the database, I don't exactly know your project details, I went through the models in /protected/models/, I guess you'll have to create the following tables:

  1. media, with fields id, name
  2. media_details with fields id, tag_id, media_url, display_url, text, profile_image_url, username, media_id, media_type_id, unique_identifier
  3. media_type with fields id, name
  4. tags with fields id, name, unix_time

and then modify your projects /protected/config/main.php file to connect to your database, like:

'db'=>array(
            'connectionString' => 'mysql:host=localhost;dbname=<your_database_name>',
            'emulatePrepare' => true, 
            'username' => 'db_username',
            'password' => 'db_password',
            'charset' => 'utf8',
        ),

Note: change db params according to your need.

I would recommend that you go through the official yii guides first and learn how yii works, you could also refer to Larry Ullman yii series which explains everything step by step.

Hope that helps.