Home  >  Article  >  Backend Development  >  What should I do if the php mysql module reports an error?

What should I do if the php mysql module reports an error?

藏色散人
藏色散人Original
2021-07-16 10:13:211781browse

php The error reported by the mysql module is because the path of libmysqlclient.so installed under Ubuntu12.04 is abnormal. The solution is to add the real path to the mysql.lsp file.

What should I do if the php mysql module reports an error?

The operating environment of this article: Windows 7 system, PHP version 7.1, DELL G3 computer

What should I do if the php mysql module reports an error? An error occurred when using the Artful MySQL module

always reports an error:

root@gitlab:/opt# newlisp
newLISP v.10.6.0 64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h
> (load "/opt/mysql.lsp")
ERR: string expected in function import : libmysqlclient

It turns out that the path of libmysqlclient.so installed under Ubuntu 12.04 is abnormal. Use find/-name to find it and add the real path to

;;; Find the libmysqlclient library on this system
(setf is-64-bit nil)
(let ((paths '("/usr/lib/libmysqlclient.so"
"/usr/lib/x86_64-linux-gnu/libmysqlclient.so" ;;here
"/usr/lib64/mysql/libmysqlclient.so"
"/usr/local/mysql/lib/libmysqlclient.dylib"
"/opt/local/lib/libmysqlclient.dylib"
"/sw/lib/libmysqlclient.dylib")))

in the mysql.lsp file is OK, the module is loaded successfully:

> (load "/opt/mysql.lsp")
MAIN

However, an error is reported when connecting to the database. It turns out that it has not kept up with the pace of newllisp 10.6.0. Now get the latest untested code:

git clone https://gist.github.com/10490156.git
> (load "/opt/10490156/mysql.lsp")
MAIN
> _MYSQL:is-64-bit
true
> (setf db (Mysql))
(Mysql 10710960)
> (:connect db "localhost" "root" "770328" "mysql")
true
> (:query db "show tables")
(MysqlResult 10812080)
> (exit)

It seems to be available, but we have to wait for the author to complete the testing.

http://www.newlispfanclub.alh.net/forum/viewtopic.php?f=16&t=4502

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What should I do if the php mysql module reports an error?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn