win7 PHP7.0的PDO擴展


一個非常棘手的問題,win7(64位)環境,編譯安裝的mysql,php無法使用pdo擴展。

image

而我的centos中yum安裝的php,pdo是好用的。

image

百度了一大堆,都無法解決。

基本上百度到的都是要開啟這兩個:

extension=php_pdo.dll
extension=php_pdo_mysql.dll

但是我的php.ini文件中根本沒有第一個,ext文件夾中也確實沒有php_pdo.dll。

而我查看http://windows.php.net/download/這里面的7.0和7.1版本,也全部都沒有php_pdo.dll這個dll,可能百度到的攻略全部是針對php5的。

image

然后懷疑是這里的問題,結果比對之下這里一抹一樣

image

 

各種懷疑,然后找了個測試文件,測試各個php擴展是否能用,這下好了curl也是不能用的,而curl也是我必須要用的。

Your server does not meet the following requirements in order to install Magento.
The following requirements failed, please contact your hosting provider in order to receive assistance with meeting the system requirements for Magento:

  • You are missing the curl extension
  • You are missing the gd extension
  • You are missing the pdo_mysql extension

The following requirements were successfully met:

  • You have PHP 5.2.0 (or greater)
  • Safe Mode is off
  • You have MySQL 4.1.20 (or greater)
  • You have the dom extension
  • You have the hash extension
  • You have the iconv extension
  • You have the mcrypt extension
  • You have the pcre extension
  • You have the pdo extension
  • You have the simplexml extension

 

實在沒轍了,網上連英文的都搜了,也沒有,只好去php文件夾一個一個看。萬幸真的看出了問題

image

 

萬般無奈之下開始找各種其他Apache下載,最后找到了偉大的phpstudy,真沒有做廣告,發現只有這個好使,它的配置是這樣的,只要按照這個配置,我其他十幾個Apache全好使了。

extension=php_bz2.dll
extension=php_curl.dll

;extension=php_fileinfo.dll
;extension=php_ftp.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_exif.dll      ; Must be after mbstring as it depends on it
extension=php_mysqli.dll
;extension=php_oci8_12c.dll  ; Use with Oracle Database 12c Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll

 

感想:

1:開源軟件,非必須的擴展,別TM開啟。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM