zoukankan      html  css  js  c++  java
  • Apache+PHP配置过程详解以及常见问题


    1.Apache配置PHP个人认为首先要注意的是ApachePHP的版本信息,不同的版本之间所要进行设置的参数是不同的,开始的盲目让自己受尽了苦头。
    2.选择版本:Apache 2.2.14  PHP:5.2.5 具体细节不再赘述。。。
    3.验证ApachePHP是否安装成功:
      (1) Apache: http://localhost
     (2)PHP:dos窗口下运行php -i
    4.PHP配置文件php.ini
      (1)修改:
    extension_dir = “./”
        extension_dir = "C:/Program Files/PHP/ext" (自己安装PHP的实际目录下ext子目录的路径)
      (2)取消注释以支持mysql数据库
         extension=php_mysql.dll
         extension=php_mysqli.dll
      (3)环境变量:
    PHPRC: C:Program FilesPHP
    Path中添加:C:Program FilesPHP
    将文件liblibmysql.dll 拷贝入C:WINDOWSsystem32
      (这一步不进行可能会报Httpd.exe错误)
    5.Apache配置文件httpd.conf
     (1)添加对php的支持
       LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"
       PHPIniDir "C:/Program Files/PHP"
     (2)实际工作的目录:
        DocumentRoot "F:/ApcheWork"
       <Directory "F:/ApcheWork">
       <Directory "F:/WWW" >
        Options FollowSymLinks
        AllowOverride None
        Order deny,allow
        allow from all
    </Directory>
     3)添加对index.php的支持
        <IfModule dir_module>
        DirectoryIndex index.php index.html
    </IfModule>
      (4) 添加类型支持
        AddType application/x-httpd-php .php
        AddType application/x-httpd-php .html
        AddType application/x-httpd-php .php .phtml .php3 .php4
    AddType application/x-httpd-php-source .phps
     
    附:配置PhpMyAdmin过程中出现的问题及解决方法
    问题1没有找到 PHP 扩展 mbstring,而您现在好像在使用多字节字符集。没有 mbstring 扩展的phpMyAdmin 不能正确分割字符串,可能产生意想不到的结果。
    解决方法:
    编辑PHP配置文件php.ini
    ;extension=php_mbstring.dll
    改成
    extension=php_mbstring.dll
     
    问题2无法加载 mcrypt 扩展 请检查您的 php 配置。
    解决方法:
    (1)找到php目录下的libmcrypt.dll,并将libmcrypt.dll复制到C:windows system32目录中
    (2)编辑PHP配置文件php.ini,,
    将“;extension=php_mcrypt.dll”
    改成extension=php_mcrypt.dll 
    问题3:链接表的额外特性尚未激活。
    解决方法:
    1)选取目录下scripts/ create_tables.sql 文件,再点击执行,会自动生成一个名为phpmyadmin的数据库。
    2)用PHP编辑器打开config.inc.php文件,找到:
    $cfg['Servers'][$i]['pmadb'] = ''; // 'phpmyadmin' - see scripts/create_tables.sql
    $cfg['Servers'][$i]['bookmarktable'] = ''; // 'pma_bookmark'
    $cfg['Servers'][$i]['relation'] = ''; // 'pma_relation'
    $cfg['Servers'][$i]['table_info'] = ''; // 'pma_table_info'
    $cfg['Servers'][$i]['table_coords'] = ''; // 'pma_table_coords'
    $cfg['Servers'][$i]['pdf_pages'] = ''; // 'pma_pdf_pages'
    $cfg['Servers'][$i]['column_info'] = ''; // 'pma_column_info'
    $cfg['Servers'][$i]['history'] = ''; // 'pma_history'
    改成:

    $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; // 'phpmyadmin' - see scripts/create_tables.sql
    $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark
    '; // 'pma_bookmark'
    $cfg['Servers'][$i]['relation'] = 'pma_relation
    '; // 'pma_relation'
    $cfg['Servers'][$i]['table_info'] = 'pma_table_info
    '; // 'pma_table_info'
    $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords
    '; // 'pma_table_coords'
    $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages
    '; // 'pma_pdf_pages'
    $cfg['Servers'][$i]['column_info'] = 'pma_column_info
    '; // 'pma_column_info'
    $cfg['Servers'][$i]['history'] = 'pma_history'; // 'pma_history'
    问题4:配置文件现在需要一个短语密码。
    解决方法:
    编辑配置文件config.inc.php,修改下项参数:$cfg['blowfish_secret'] = '123456';
    问题5:如果出现找不到php5apatch2_2.dll
    重新到官网http://windows.php.net/download下载Thread Safe版本的php包,解压完了后记得重新配置php.ini(在解压后呈现为php.ini-development,q)
  • 相关阅读:
    398. Random Pick Index
    382. Linked List Random Node
    645. Set Mismatch
    174. Dungeon Game
    264. Ugly Number II
    115. Distinct Subsequences
    372. Super Pow
    LeetCode 242 有效的字母异位词
    LeetCode 78 子集
    LeetCode 404 左叶子之和
  • 原文地址:https://www.cnblogs.com/dashafa/p/4021253.html
Copyright © 2011-2022 走看看