« | February 2019 | » | 日 | 一 | 二 | 三 | 四 | 五 | 六 | | | | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | | | |
| 公告 |
戒除浮躁,读好书,交益友 |
Blog信息 |
blog名称:邢红瑞的blog 日志总数:523 评论数量:1142 留言数量:0 访问次数:9190568 建立时间:2004年12月20日 |

| |
[opensource]安装php5 原创空间, 文章收藏, 软件技术, 电脑与网络
邢红瑞 发表于 2011-5-26 16:55:04 |
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-xml --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/lib --with-zlib --disable-debug --enable-safe-mode --enable-trans-sid --enable-memory-limit --enable-short-tags --disable-posix --enable-exif --enable-ftp --enable-sockets --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl
make make install make clean cp php.ini-dist /usr/local/lib/php.ini
编辑php.ini文件: 查找: ;default_charset = "iso-8859-1" 在这行下面加一行 default_charset = "gbk"
不能把AddType application/x-httpd-php .php 直接加入httpd.conf文件启动apache出现Invalid command 'AddType', perhaps misspelled or defined by a module not included in the server configuration加入<IfModule mime_module> # # TypesConfig points to the file containing the list of mappings from # filename extension to MIME-type. # TypesConfig conf/mime.types
# # AddType allows you to add to or override the MIME configuration # file specified in TypesConfig for specific file types. # #AddType application/x-gzip .tgz # # AddEncoding allows you to have certain browsers uncompress # information on the fly. Note: Not all browsers support this. # #AddEncoding x-compress .Z #AddEncoding x-gzip .gz .tgz # # If the AddEncoding directives above are commented-out, then you # probably should define those extensions to indicate media types: # AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType application/x-httpd-php .php # # AddHandler allows you to map certain file extensions to "handlers": # actions unrelated to filetype. These can be either built into the server # or added with the Action directive (see below) # # To use CGI scripts outside of ScriptAliased directories: # (You will also need to add "ExecCGI" to the "Options" directive.) # #AddHandler cgi-script .cgi
# For type maps (negotiated resources): #AddHandler type-map var
# # Filters allow you to process content before it is sent to the client. # # To parse .shtml files for server-side includes (SSI): # (You will also need to add "Includes" to the "Options" directive.) # #AddType text/html .shtml #AddOutputFilter INCLUDES .shtml</IfModule><IfModule dir_module> DirectoryIndex index.html index.php</IfModule>修改httpd.conf加入LoadModule authz_host_module modules/mod_authz_host.soLoadFile /usr/lib/libxml2.soLoadModule mime_module modules/mod_mime.so
LoadModule php5_module modules/libphp5.so否则会出现[Thu May 26 22:22:22 2011] [error] [client 192.168.100.216] Attempt to serve directory: /usr/local/apache2/htdocs/[Thu May 26 22:39:47 2011] [notice] caught SIGTERM, shutting down[Thu May 26 22:39:50 2011] [notice] Apache/2.2.17 (Unix) PHP/5.2.17 configured -- resuming normal operations[Thu May 26 22:43:07 2011] [notice] caught SIGTERM, shutting down
|
|
|