drq231358 2015-09-09 07:15
浏览 93

“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.

  • 写回答

1条回答 默认 最新

  • dqk77945 2015-09-13 13:41
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来