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

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

Jul 16, 2021 am 10:13 AM
mysql php

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 of this Website
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

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to read a CSV file in PHP? How to read a CSV file in PHP? Aug 29, 2025 am 08:06 AM

ToreadaCSVfileinPHP,usefopen()toopenthefile,fgetcsv()inalooptoreadeachrowasanarray,andfclose()tocloseit;handleheaderswithaseparatefgetcsv()callandspecifydelimitersasneeded,ensuringproperfilepathsandUTF-8encodingforspecialcharacters.

How to use AJAX with php How to use AJAX with php Aug 29, 2025 am 08:58 AM

AJAXwithPHPenablesdynamicwebappsbysendingasynchronousrequestswithoutpagereloads.1.CreateHTMLwithJavaScriptusingfetch()tosenddata.2.BuildaPHPscripttoprocessPOSTdataandreturnresponses.3.UseJSONforcomplexdatahandling.4.Alwayssanitizeinputsanddebugviabro

What is the difference between isset and empty in php What is the difference between isset and empty in php Aug 27, 2025 am 08:38 AM

isset()checksifavariableexistsandisnotnull,returningtrueevenforzero,false,oremptystringvalues;2.empty()checksifavariableisnull,false,0,"0","",orundefined,returningtrueforthese"falsy"values;3.isset()returnsfalsefornon-exi

How to get the current date and time in PHP? How to get the current date and time in PHP? Aug 31, 2025 am 01:36 AM

Usedate('Y-m-dH:i:s')withdate_default_timezone_set()togetcurrentdateandtimeinPHP,ensuringaccurateresultsbysettingthedesiredtimezonelike'America/New_York'beforecallingdate().

How to configure SMTP for sending mail in php How to configure SMTP for sending mail in php Aug 27, 2025 am 08:08 AM

Answer: Using the PHPMailer library to configure the SMTP server can enable sending mails through SMTP in PHP applications. PHPMailer needs to be installed, set up SMTP host, port, encryption method and authentication credentials of Gmail, write code to set sender, recipient, topic and content, enable 2FA and use application password to ensure that the server allows SMTP connection, and finally call the send method to send email.

How to create an object in php How to create an object in php Aug 27, 2025 am 08:45 AM

To create a PHP object, you need to define the class first, and then instantiate it with the new keyword. For example, after defining the Car class and setting properties and constructing methods, create an object through $myCar=newCar("red","Toyota"), and then use -> to access its properties and methods, such as $myCar->color and $myCar->showInfo(). Each object has independent data and can create multiple instances.

How to set an error reporting level in PHP? How to set an error reporting level in PHP? Aug 31, 2025 am 06:48 AM

Useerror_reporting()toseterrorlevelsinPHP,suchasE_ALLfordevelopmentor0forproduction,andcontroldisplayorloggingviaini_set()toenhancedebuggingandsecurity.

How to use the spaceship operator () in PHP? How to use the spaceship operator () in PHP? Aug 29, 2025 am 06:31 AM

PHP's spaceship operator is used to compare two values, returning -1, 0 or 1: when the left operand is smaller than the right operand, return -1, when equal to 0, and when greater than 1. It supports types such as numbers and strings, and is often used in sorting scenarios such as usort, making the multi-level sorting logic more concise and clear, and is available since PHP7.0.

See all articles