Build a php learning framework mycake

Source: Internet
Author: User

You need to use php to take over immediately. Although you have never touched it before, you can learn it freely. I basically decided to get started with php as soon as possible through practical methods.


After some understanding, I found that php is used to build websites very quickly, and there are also many mature open-source php frameworks on the Internet. I think learning php in this way may be more efficient. What you see is what you get.


1. Prepare the environment and install basic components such as apache, mysql, and php. I have already thanked them in the previous article. I will not describe them here. Suppose we have prepared the basic environment.


2. Download cakephp. The official website is http://cakephp.org /.


3. Enter the/var/www/directory -------- because apache's webpage directory is under this directory by default. If you change the path yourself, enter the root directory of Your webpage.

Create a folder named mycake,

Decompress the downloaded cakephp file to mycake. In theory, you can access cakephp through 127.0.0.1/mycake.


4. The next problem is to handle the various problems prompted on the home page.

4.1 some rewrite failures occur. This is a directory permission issue.

Go to the configuration directory of apache. By default, go to the/etc/apache2/directory of sites-enabled/and modify the configuration,

DocumentRoot/var/www
<Directory/>
Options FollowSymLinks
AllowOverride all
</Directory>
<Directory/var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
# Order allow, deny
Allow from all
</Directory>

Modify the red part to grant the write permission.


4.2 continue to find that an app/tmp cannot be written. This should be due to a directory permission error,

Log on to/var/www/mycake/app, and choose chmod-R 777 tmp.

Then we can fix it.

 

4.3 An ulr rewrite problem was found. This is because apache did not load the rewrite module.

Go to/etc/apache2/, and go to mod-enable,

Then execute ln-s rewrite_load ../mod-available/rewrite. load

The effect is to establish a soft connection, rewrite. load-> ../mod-available //, and then restart apache

So far, the success is as follows:


Next, we will prepare for e-commerce in LCD, IGBT, and HMI.



From ShiningStarPxx's column


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.