因为某种原因,我没有使用yum来安装LAMP。而LAMP对我来说很不熟悉,只能参考网上的文章一步步的做。为了避免每次都要goo一次这类东西,就自己写一篇放在这里吧。
1. 安装MySQL
因为我之前把这台机器装成一台简单的测试机,大量Package没有安装,所以安装MySQL时有点麻烦,按照dependency,我把好多包都往上打了:
rpm -ivh /
mysql-5.0.45-4.fc8.i386.rpm /
mysql-libs-5.0.45-4.fc8.i386.rpm /
mysql-server-5.0.45-4.fc8.i386.rpm /
php-mysql-5.2.4-3.i386.rpm /
php-common-5.2.4-3.i386.rpm /
php-pdo-5.2.4-3.i386.rpm /
perl-DBI-1.58-2.fc8.i386.rpm /
perl-DBD-MySQL-4.005-2.fc8.1.i386.rpm
2. 安装apache和PHP
rpm -ivh /
httpd-2.2.6-3.i386.rpm /
php-5.2.4-3.i386.rpm /
php-cli-5.2.4-3.i386.rpm /
php-xml-5.2.4-3.i386.rpm /
httpd-tools-2.2.6-3.i386.rpm /
gmp-4.2.2-3.fc8.i386.rpm
3. 配置Apache
设置DirectoryIndex,加入index.php
加入两条AddType:
AddType application/x-httpd-php .php .phtml .php3 .inc
AddType application/x-httpd-php-source .phps
4. 测试
# cat > index.php << EOF
> <?php
> echo phpinfo();
> ?>
> EOF
1. 安装MySQL
因为我之前把这台机器装成一台简单的测试机,大量Package没有安装,所以安装MySQL时有点麻烦,按照dependency,我把好多包都往上打了:
rpm -ivh /
mysql-5.0.45-4.fc8.i386.rpm /
mysql-libs-5.0.45-4.fc8.i386.rpm /
mysql-server-5.0.45-4.fc8.i386.rpm /
php-mysql-5.2.4-3.i386.rpm /
php-common-5.2.4-3.i386.rpm /
php-pdo-5.2.4-3.i386.rpm /
perl-DBI-1.58-2.fc8.i386.rpm /
perl-DBD-MySQL-4.005-2.fc8.1.i386.rpm
2. 安装apache和PHP
rpm -ivh /
httpd-2.2.6-3.i386.rpm /
php-5.2.4-3.i386.rpm /
php-cli-5.2.4-3.i386.rpm /
php-xml-5.2.4-3.i386.rpm /
httpd-tools-2.2.6-3.i386.rpm /
gmp-4.2.2-3.fc8.i386.rpm
3. 配置Apache
设置DirectoryIndex,加入index.php
加入两条AddType:
AddType application/x-httpd-php .php .phtml .php3 .inc
AddType application/x-httpd-php-source .phps
4. 测试
# cat > index.php << EOF
> <?php
> echo phpinfo();
> ?>
> EOF