Lamp + yii

Source: Internet
Author: User
Installation environment:
Centos x86_64 GNU/Linux (2.6.18-92. EL5)
1. Install software
Step 1: install Apache
Required installation package:
Apr-1.2.7-11.el5_6.5.x86_64.rpm
Apr-devel-1.2.7-11.el5_6.5.x86_64.rpm
Apr-util-1.2.7-11.el5_5.2.x86_64.rpm
Apr-util-devel-1.2.7-11.el5_5.2.x86_64.rpm
Httpd-2.2.3-45.el5.centos.1.x86_64.rpm
Httpd-devel-2.2.3-45.el5.centos.1.x86_64.rpm
Httpd-manual-2.2.3-45.el5.centos.1.x86_64.rpm
Mod_ssl-2.2.3-45.el5.centos.1.x86_64.rpm
Openssl-0.9.8e-12.el5_5.7.x86_64.rpm
Openssl-devel-0.9.8e-12.el5_5.7.x86_64.rpm
Step 2: Install MySQL
Required installation package
Mysql-client-5.1.52-1.x86_64.rpm
Mysql-common-5.1.52-1.x86_64.rpm
Mysql-server-5.1.52-1.x86_64.rpm
Step 3: install PHP
Required installation package
Php-mysql-5.1.6-27.el5_5.3.x86_64.rpm
Php-5.1.6-27.el5_5.3.x86_64.rpm
Php-mysql-5.1.6-27.el5_5.3.x86_64.rpm
Php-common-5.1.6-27.el5_5.3.x86_64.rpm
Php-pdo-5.1.6-27.el5_5.3.x86_64.rpm
Php-ldap-5.1.6-27.el5_5.3.x86_64.rpm
Php-cli-5.1.6-27.el5_5.3.x86_64.rpm

Ii. Configuration
1. Apache configuration file
/Etc/httpd/CONF/httpd. conf
A. comment out the following content, or the following error will occur: 403 Forbidden: You don't have permission to access/on this server.
<Directory/>
Options followsymlinks
AllowOverride none
# Order allow, deny # comment out
# Allow from all # comment out

</Directory>
B. Configure the virtual host (a host corresponds to an application service, a home directory, and a host name)
/Etc/httpd/CONF. d/virtual. conf
Namevirtualhost *: 80

<Virtualhost *: 80>
# Serveradmin webmaster@dummy-host.example.com
DocumentRoot/wwwroot/blog/
Servername www.example.com
Errorlog logs/www.example.com-error_log
Customlog logs/www.example.com-access_log common
</Virtualhost>

2. Configure PHP and add the following content:
/Etc/PHP. ini
Extension = msql. So
Extension = pdo_mysql.so

If the preceding content is not added, the following error occurs: yiibase: Include (PDO. php): failed to open stream:
3. Configure the blog application as instructed by yii

Reference Book yii_blog_book use yii to create a blog

Iii. Problems:
1. First question: yii-you are not allowed to access this page
Error 403
You are not allowed to access this page.

Problem Analysis: yii is under security considerations. Gii components can be run on the local machine by default. Therefore, the above problems usually occur when the server is not the local machine.

Solution: edit your main. PHP configuration file.

'Modules' => array (
'Giii '=> array (
'Class' => 'System. GiI. giimodule ',
'Password' => 'Password ',
'Ipfilters '=> array ('192. 0.0.1', ': 1'), // change the IP address here to the current IP address of the local machine.
),
),
Set your local IP address in ipfilters (remember that your local Client IP address is not the Server IP address)
From (scaffold http://y-projects.tk /)

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.