10/10/2018, 09:31

Ức chế PHP5 & MySQL5

Chào các bác,

Em đang vô cùng ức chế với 2 cái này suốt mấy ngày nay. Không làm sao cho thằng MySQL hoạt động cùng với PHP được.

Em tả lại quá trình làm thế này cho các bác xem nhé:

1) Download & Install MySQL 5.0.27 (Windows Installer). Test query browser -> OK.

2) Download & Install PHP 5.05 (cũng Windows Installer nốt).

3) Create 1 file test.php:
<?php
phpinfo();
?>

http://localhost/test.php -> OK

3) Download 2 file php_mysql.dll & libmysql.dll từ http://dev.mysql.com/downloads/connector/php. Rồi tống thằng php_mysql.dll -> C:PHPext, libmysql.dll -> C:WINDOWSSYSTEM32.

4) Uncomment cái dòng extension=php_mysql.dll trong file php.ini

5) Lần này mở test.php thì nó thông báo lỗi:
"PHP Warning: PHP Startup: Unable to load dynamic library 'C:PHPextphp_mysql.dll' - The specified procedure could not be found. in Unknown on line 0"

Đấy. Các bác xem em làm sai chỗ nào mà nó cứ bung ra cái thông báo dở hơi đó chứ.
mrsinguyenus viết 11:31 ngày 10/10/2018
Chắc chưa config cái extension dir thôi bạn tìm cái ext dir để config là C:\PHP\ext
C:\WINDOWS\php.ini
extension_dir = "C:/PHP/ext/"
ixplorer viết 11:40 ngày 10/10/2018
Được gửi bởi mrsinguyenus
Chắc chưa config cái extension dir thôi bạn tìm cái ext dir để config là C:\PHP\ext
C:\WINDOWS\php.ini
extension_dir = "C:/PHP/ext/"
Được gửi bởi ixplorer
5) Lần này mở test.php thì nó thông báo lỗi:
"PHP Warning: PHP Startup: Unable to load dynamic library 'C:\PHP\ext\php_mysql.dll' - The specified procedure could not be found. in Unknown on line 0"
Nếu ko set "extension_dir=C:\PHP\Ext" thì làm sao nó thông báo như thế được.

Các bác chả đọc kỹ j cả
anhtuannd viết 11:37 ngày 10/10/2018
Lỗi này em cũng mù, nhưng theo như những gì em thấy ở trên thì nguyên nhân chủ yếu đến từ 2 file php_mysql.dll & libmysql.dll.
Để mai em thử cài 2 thằng này xem sao
anhtuannd viết 11:39 ngày 10/10/2018
How do I install the mysql/mysqli extensions for PHP?

Installing the extensions is easy. You have to verify two settings in your php.ini configuration file and copy the extensions to the php extension directory.

Step by step:

* Unpack the download archive

* Copy the php_*.dll files to your PHP extension directory
You can look up and confiugure the PHP extension directory in your php.ini file. A typical location for the php.ini file is C:\php\php.ini. The PHP extension directory is configured using the extension_dir setting, for example:
extension_dir = C:\php\extensions
Copy the php_*.dll files contained in the download to your PHP extension directory, for example to: C:\php\extensions

* Enable the PHP extensions that you want to use in the php.ini file
Uncomment or add the following lines to your php.ini file:
// MySQL extension
extension=php_mysql.dll
// MySQLi extension
extension=php_mysqli.dll

* Copy the libmysql.dll to the PHP installation directory
A typical location for your PHP installation directory is C:\php . Exchange the libmysql.dll file that is in the directory and overwrite it with the file from the download archive.

Chắc vấn đề ở đây ạ?
ixplorer viết 11:38 ngày 10/10/2018
Không phải vậy đâu. Mình cài bản PHP Windows Installer nên mặc định ko có extension nào hết, phải down 2 file php_mysql.dll và libmysql.dll từ trang dev.mysql.com về.

Mình cũng cẩn thận thử download cả PHP5 Zip Package về rồi upzip & copy đè cả 2 file trên nhưng cũng ko có j khác biệt.
mrsinguyenus viết 11:37 ngày 10/10/2018
Tôi nhầm cái trên đọc không kỹ. Xin lỗi, vậy cái file dll đó có vấn đề, tìm bản nào có đầy đủ rồi ghi đè vào đó, chạy file phpcgi.reg gì đó config như trên ok
thienthan36 viết 11:46 ngày 10/10/2018
Không biết làm thế này được không nhé
copy file : libmysql.dll vào c:\php\ hay c:\apache\bin (nếu dùng modules of apache
copy file php_***.dll vào c:\php\ext
cấu hình file php.ini : extension_dir = c:\php\exe

hy vọng bạn chạy được
ixplorer viết 11:34 ngày 10/10/2018
Từ hồi post bài đến giờ mình vẫn chưa làm sao cho PHP5.0 làm việc với MySQL5.0 nên đành quay lại với PHP4 & MySQL4.
Tuy nhiên hôm qua mình vừa download thử PHP5.2 thì thấy lần này PHP Installer đã thay đổi, theo đó MySQL Connection Tool được gắn luôn với bộ cài PHP. Khi chạy setup chỉ cần select MySQL trong phần Extension. That's all!
kemkem viết 11:32 ngày 10/10/2018
không cài được thì dùng cái tích hợp đi.
tôi đang dùng bản vetrigo mới nhất:
thông sô:
Apache: 2.0
PHP: 5.2
Mysql:5.0
ngoài ra nó còn tích hợp các tool như:
phpmyadmin 2.9
SQLlite
zend..
bạn có thể download tại đây:
http://download.ttv.vn/
Bài liên quan
0