Using the GII in "Unable to write the file"

Source: Internet
Author: User
??

Using the GII in "Unable to write the file"

obviously this is because the GII does not have permission to write files, so if you follow http://www.yiichina.com/doc/guide/2.0/start-gii here and before the steps to do, you must first remove the following files:

rm/var/www/html/basic/models/country.php

rm/var/www/html/basic/controllers/countrycontroller.php

rm/var/www/html/basic/views/country/index.php

Then give the Web permission:

Chown Www-data:www-data/var/www/html/basic/models

Chown Www-data:www-data/var/www/html/basic/controllers

Chown Www-data:www-data/var/www/html/basic/views/country

you will then be able to access HTTP//machine name/basic/web/index.php?r=gii to generate model and crud and access the page after it's finished. HTTP//machine name/basic/web/index.php?r=country/index , it's best to change the permissions back when everything is working properly:

Chown Root:root/var/www/html/basic/models

Chown Root:root/var/www/html/basic/controllers

Chown Root:root/var/www/html/basic/views/country

The above describes the use of the GII in the "Unable to write the file", including aspects of the content, want to be interested in the PHP tutorial friends helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.