vi /etc/httpd/httpd.conf If the AddEncoding directives above are commented-out, then you # probably should define those extensions to indicate media types:AddType application/x-compress .ZAddType application/x-gzip .gz .tgz 在这行下面添加 Addtype application/x-httpd-php .php .phtml #添加这一条#添这一个是为了将.phps作为PHP的源文件进行语法高亮显示 Addtype application/x-httpd-php-source .phps # AddHandler allows you to map certain file extensions to "handlers": # actions unrelated to filetype. These can be either built into the server 6.修改apache的配置文件后,需要重启服务器才能重新加载修改后的配置文件 /usr/local/apache2/bin/apachectl stop /usr/local/apache2/bin/apachectl start 7.如果安装后在/usr/local/php/etc/目录下没有找到php.ini配置文件,可以在php源码包中复制php.ini-dist文件到/usr/local/php/etc/并改名为php.ini 安装ZendOptimizer-3.3.0a-linux-glibc21-i386.tar.gz 1.解压ZendOptimizer-3.3.0a-linux-glibc21-i386.tar.gz tar zxvf ZendOptimizer-3.3.0a-linux-glibc21-i386.tar.gz 2.进入ZendOptimizer-3.3.0a-linux-glibc21-i386 cd ZendOptimizer-3.3.0a-linux-glibc21-i386 3.执行安装 ./install.sh 4.执行上面的操作会出现一个图形安装界面,按提示安装即可 5.安装成功 环境搭建完毕!你可以尽情体会PHP的强大功能了 |