您的位置:首页 > 运维架构 > Apache

linux下配置php Apache mysql

2014-08-06 14:55 429 查看
一 Apache部分

/article/6818812.html
里面是纠正了原文的一些小错误,即可正常安装

1、su 命令
2、安装apr-1.3.5.tar.gz
# tar zxvf apr-1.3.5.tar.gz

# cd apr-1.3.5

# ./configure
出现错误
no acceptable C compiler found in $PATH
---------------------------------------------
解决方案,没有按照GCC套件
切换到root权限: su
输入密码后即为root权限,然后保证电脑能联网,输入:
yum install gcc

#make

#make install
3、
安装apr-util-1.3.7.tar.gz
# tar zxvf apr-util-1.3.7.tar.gz

# cd apr-util-1.3.7

# . /configure --with-apr=/usr/local/apr
./configure --with-apr=/usr/local/apr(这个是修正之后的)

# make

# make install
4
安装httpd-2.2.11.tar.gz
# tar zxvf httpd-2.2.11.tar.gz

# ./configure --prefix=/usr/local/apache2 --enable-dav --enable-modules=so --enable-maintainer-mode --enable-rewrite

--with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config

【bash: ./configure: 没有那个文件或目录

--------------------------------------------------

解决方案: chmod a+x configure 修改一下这个文件的权限即可】

# make

# make install

启动Apache服务:

# /usr/local/apache2/bin/apachectl start
apache启动时
出现错误 httpd: apr_sockaddr_info_get() failed for
httpd: apr_sockaddr_info_get() failed for VM_74_204_centos
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
解决方案
--------------------------------------------
在Apache的安装目录下的conf文件修改httpd.conf如下
(1) ServerName localhost:80

或者在 /etc/hosts 中填入自己的主机名称 bogon,如下:
(2)127.0.0.1 bogon
---------------------------------------------
并且编辑如下:
编辑 /usr/local/apache2/conf/httpd.conf 文件
找到: AddType application/x-compress .Z AddType application/x-gzip .gz .tgz
在后面添加:
AddType application/x-httpd-php .php(使Apcche支持PHP) A
ddType application/x-httpd-php-source .php5
找到: <IfModule dir_module> DirectoryIndex index.html </IfModule>
添加: <IfModule dir_module> DirectoryIndex index.html index.php </IfModule>
找到: #ServerName www.example.com:80
修改为: ServerName 127.0.0.1:80或者ServerName localhost:80
记得要去掉前面的“#”

用浏览器查看http://localhost/,得到It works!

说明apache已经配置成功了。

---------------------------------------------

参考文章:/article/6152069.html

出现错误:libphp5.so没有编译成功

------------------------------

解决方案:在Apache的安装目录下http.conf配置文件下

增加这一行 LoadModule php5_module /usr/local/apache2/modules/libphp5.so
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: