免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6045 | 回复: 5
打印 上一主题 下一主题

apache不能解析php [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-23 08:51 |只看该作者 |倒序浏览
以下是我安装的过程
更新ports略过
安装apache
cd /usr/ports/www/apache22
make
make install
make clean

##################################################################################################################
安装mysql

pw addgroup mysql
pw adduser mysql

cd /usr/ports/database/mysql51-server
make
make install
make clean
rehash
cp /usr/local/share/mysql/my-medium.cnf /etc/my.cnf                ##具体看服务器的硬件配置拷贝相应的.cnf文件
cd /usr/local/bin
mysql_install_db -user=mysql                                  ##初始化MYSQL数据库
chown mysql:mysql /etc/my.cnf && chmod 600 /etc/my.cnf  
chown -R mysql:mysql /var/db/mysql           ##系统中若/var/db/mysql 无,则使用命令/usr/local/bin/mysqlbug
/usr/local/bin/mysqld_safe -u mysql &                      ##后台启动MYSQL

/usr/local/bin/mysql to connect to the mysql   #####命令行MYSQL
database and look at the grant tables:

shell> /usr/local/bin/mysql -u root mysql
mysql> show tables

Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /var/db/mysql that may be helpful.

/usr/local/bin/mysqladmin -u root password 'new-password'
/usr/local/bin/mysqladmin -u root -h cacti.pplive.com password 'root'

########################################################################################################################
pkg_info           ###查看安装包
安装php
cd /usr/ports/lang/php5
make
                                                                [X] CLI        Build CLI version                              | |
                           | |  [X] CGI        Build CGI version                              | |
                           | |  [X] APACHE     Build Apache module                            | |
                           | |  [ ] DEBUG      Enable debug                                   | |
                           | |  [X] SUHOSIN    Enable Suhosin protection system               | |
                           | |  [ ] MULTIBYTE  Enable zend multibyte support                  | |
                           | |  [ ] IPV6       Enable ipv6 support                            | |
                           | |  [ ] MAILHEAD   Enable mail header patch                       | |
                           | |  [ ] REDIRECT   Enable force-cgi-redirect support (CGI only)   | |
                           | |  [ ] DISCARD    Enable discard-path support (CGI only)         | |
                           | |  [X] FASTCGI    Enable fastcgi support (CGI only)              | |
                           | |  [X] PATHINFO   Enable path-info-check support (CGI only)      | |
                                                                                 

make install
make clean

cd /usr/ports/lang/php5-extensions           ##安装扩展套件
make

                           | |   [ ] BCMATH      bc style precision math functions            | |
                           | |   [X] BZ2         bzip2 library support                        | |
                           | |   [ ] CALENDAR    calendar conversion support                  | |
                           | |   [X] CTYPE       ctype functions                              | |
                           | |   [ ] CURL        CURL support                                 | |
                           | |   [ ] DBA         dba support                                  | |
                           | |   [ ] DBASE       dBase library support                        | |
                           | |   [X] DOM         DOM support                                  | |
                           | |   [ ] EXIF        EXIF support                                 | |
                           | |   [ ] FILEINFO    fileinfo support                             | |
                           | |   [X] FILTER      input filter support                         | |
                           | |   [ ] FRIBIDI     FriBidi support                              | |
                           | |   [ ] FTP         FTP support                                  | |
                           | |   [X] GD          GD library support                           | |
                           | |   [ ] GETTEXT     gettext library support                      | |
                           | |   [ ] GMP         GNU MP support                               | |
                           | |   [X] HASH        HASH Message Digest Framework                | |
                           | |   [X] ICONV       iconv support                                | |
                           | |   [ ] IMAP        IMAP support                                 | |
                           | |   [ ] INTERBASE   Interbase 6 database support (Firebird)      | |
                           | |   [X] JSON        JavaScript Object Serialization support      | |
                           | |   [ ] LDAP        OpenLDAP support                             | |
                           | |   [ ] MBSTRING    multibyte string support                     | |
                           | |   [ ] MCRYPT      Encryption support                           | |
                           | |   [ ] MHASH       Crypto-hashing support                       | |
                           | |   [ ] MING        ming shockwave flash support                 | |
                           | |   [X] MSSQL       MS-SQL database support                      | |
                           | |   [X] MYSQL       MySQL database support                       | |
                           | |   [ ] MYSQLI      MySQLi database support                      | |
                           | |   [ ] NCURSES     ncurses support (CLI only)                   | |
                           | |   [ ] ODBC        unixODBC support                             | |
                           | |   [ ] OPENSSL     OpenSSL support                              | |
                           | |   [ ] PCNTL       pcntl support (CLI only)                     | |
                           | |   [X] PCRE        Perl Compatible Regular Expression support   | |
                           | |   [ ] PDF         PDFlib support (implies GD)                  | |
                           | |   [X] PDO         PHP Data Objects Interface (PDO)             | |
                           | |   [X] PDO_SQLITE  PDO sqlite driver                            | |
                           | |   [ ] PGSQL       PostgreSQL database support                  | |
                           | |   [X] POSIX       POSIX-like functions                         | |
                           | |   [ ] PSPELL      pspell support                               | |
                           | |   [ ] READLINE    readline support (CLI only)                  | |
                           | |   [ ] RECODE      recode support                               | |
                           | |   [X] SESSION     session support                              | |
                           | |   [ ] SHMOP       shmop support                                | |
                           | |   [X] SIMPLEXML   simplexml support                            | |
                           | |   [X] SNMP        SNMP support                                 | |
                           | |   [ ] SOAP        SOAP support                                 | |
                           | |   [X] SOCKETS     sockets support                              | |
                           | |   [X] SPL         Standard PHP Library                         | |
                           | |   [X] SQLITE      sqlite support                               | |

                          |                 Options for php5-extensions 1.1                    |
                           | +-------^(-)-----------------------------------------------------+ |
                           | |   [ ] SYBASE_CT   Sybase database support                      | |
                           | |   [ ] SYSVMSG     System V message support                     | |
                           | |   [ ] SYSVSEM     System V semaphore support                   | |
                           | |   [ ] SYSVSHM     System V shared memory support               | |
                           | |   [ ] TIDY        TIDY support                                 | |
                           | |   [X] TOKENIZER   tokenizer support                            | |
                           | |   [ ] WDDX        WDDX support (implies XML)                   | |
                           | |   [X] XML         XML support                                  | |
                           | |   [X] XMLREADER   XMLReader support                            | |
                           | |   [ ] XMLRPC      XMLRPC-EPI support                           | |
                           | |   [X] XMLWRITER   XMLWriter support                            | |
                           | |   [ ] XSL         XSL support (Implies DOM)                    | |
                           | |   [ ] YAZ         YAZ support (ANSI/NISO Z39.50)               | |
                           | |   [ ] ZIP         ZIP support                                  | |
                           | |   [X] ZLIB        ZLIB support   


make install
make clean
cd /usr/ports/devel/ZendOptimizer/
#make install clean
# ee /usr/local/etc/php.ini
//如果你打开是空白.那一定是忘了
# cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini//
//然后再
# ee /usr/local/etc/php.ini
//在最下边加上.
[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer="/usr/local/lib/php/20050922-zts/Optimizer"
zend_extension_manager.optimizer_ts="/usr/local/lib/php/20050922-zts/Optimizer_TS"
zend_extension="/usr/local/lib/php/20050922-zts/ZendExtensionManager.so"
zend_extension_ts="/usr/local/lib/php/20050922-zts/ZendExtensionManager_TS.so"
#修改 httpd.conf
vi /usr/local/etc/apache22/httpd.conf
加入下面幾行,才能支援 PHP
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
DirectoryIndex index.html index.php index.htm  index.pl index.cgi
测试PHP+APACHE
vi /usr/local/www/apache22/data/info.php
<?php
phpinfo();
?>

但是apache就是解析不了php

高人请看

论坛徽章:
0
2 [报告]
发表于 2008-04-23 15:17 |只看该作者
安装php时有问题,你在查一下安装步骤在网上

论坛徽章:
0
3 [报告]
发表于 2008-04-23 15:51 |只看该作者
LoadModule php5_module        libexec/apache2/libphp5.so  这句加了吗

论坛徽章:
0
4 [报告]
发表于 2009-02-03 16:38 |只看该作者
~~~~我也是同样问题~~~

论坛徽章:
0
5 [报告]
发表于 2009-02-04 13:39 |只看该作者
你在主页缺省那块加了指向没,index.php
我一直也是bsd下搞的,刚刚装好的,ports安装,一点问题没有,非常顺利
步骤我一定是先mysql,再apache,再来php,这绝对没问题!

论坛徽章:
0
6 [报告]
发表于 2009-02-04 18:48 |只看该作者
楼上的看下这个
DirectoryIndex index.html index.php index.htm  index.pl index.cgi
是设置了默认首页index.php的,重要的是你打开php页面会提示什么,
下载还是直接显示代码?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP