微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

调用未定义的函数mysql_query

我无法在这个网站上find这个问题。 当我加载我的网页,我得到以下错误

Call to undefined function MysqL_query()

所以我检查了我的PHPinfo()文件,我找不到MysqL扩展或任何扩展。 所以我进入我的PHP ini文件,并取消了扩展名

extension=PHP_pdo_mssql.dll extension=PHP_pdo_MysqL.dll

我重新启动我的Apache服务器和MysqL,但没有任何更改,扩展名不被识别。 我有MysqL服务器运行,我有Apache运行的PHP,但我很难得到扩展加载。 所以我检查了我的扩展目录(目录我的PHPinfo()指定,并没有什么。)MacPorts安装除了我的扩展一切。 有没有搞错 ?? 还有什么我失踪了。

PHP.ini中

;;;;;;;;;;;;;;;;;;;;;; ; Dynamic Extensions ; ;;;;;;;;;;;;;;;;;;;;;; ; If you wish to have an extension loaded automatically,use the following ; Syntax: ; ; extension=modulename.extension ; ; For example,on Windows: ; ; extension=msql.dll ; ; ... or under UNIX: ; ; extension=msql.so ; ; ... or with a path: ; ; extension=/path/to/extension/msql.so ; ; If you only provide the name of the extension,PHP will look for it in its ; default extension directory. ; ; Windows Extensions ; Note that ODBC support is built in,so no dll is needed for it. ; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5) ; extension folders as well as the separate PECL DLL download (PHP 5). ; Be sure to appropriately set the extension_dir directive. ; ;extension=PHP_bz2.dll extension=php_curl.dll ;extension=PHP_fileinfo.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_MysqL.dll extension=PHP_MysqLi.dll ;extension=PHP_oci8.dll ; Use with Oracle 10gR2 Instant Client ;extension=PHP_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client ;extension=PHP_openssl.dll ;extension=PHP_pdo_firebird.dll extension=PHP_pdo_mssql.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_pspell.dll ;extension=PHP_shmop.dll ; The MIBS data available in the PHP distribution must be installed. ; See http://www.PHP.net/manual/en/snmp.installation.PHP ;extension=PHP_snmp.dll extension=PHP_soap.dll extension=PHP_sockets.dll extension=PHP_sqlite.dll extension=PHP_sqlite3.dll ;extension=PHP_sybase_ct.dll ;extension=PHP_tidy.dll ;extension=PHP_xmlrpc.dll ;extension=PHP_xsl.dll ;extension=PHP_zip.dll ;;;;;;;;;;;;;;;;;;; ; Module Settings ; ;;;;;;;;;;;;;;;;;;; [Date] ; Defines the default timezone used by the date functions ; http://PHP.net/date.timezone ;date.timezone = ; http://PHP.net/date.default-latitude ;date.default_latitude = 31.7667 ; http://PHP.net/date.default-longitude ;date.default_longitude = 35.2333 ; http://PHP.net/date.sunrise-zenith ;date.sunrise_zenith = 90.583333 ; http://PHP.net/date.sunset-zenith ;date.sunset_zenith = 90.583333 [filter] ; http://PHP.net/filter.default ;filter.default = unsafe_raw ; http://PHP.net/filter.default-flags ;filter.default_flags = [iconv] ;iconv.input_encoding = ISO-8859-1 ;iconv.internal_encoding = ISO-8859-1 ;iconv.output_encoding = ISO-8859-1 [intl] ;intl.default_locale = ; This directive allows you to produce PHP errors when some error ; happens within intl functions. The value is the level of the error produced. ; Default is 0,which does not produce any errors. ;intl.error_level = E_WARNING [sqlite] ; http://PHP.net/sqlite.assoc-case ;sqlite.assoc_case = 0 [sqlite3] ;sqlite3.extension_dir = [Pcre] ;PCRE library backtracking limit. ; http://PHP.net/pcre.backtrack-limit ;pcre.backtrack_limit=100000 ;PCRE library recursion limit. ;Please note that if you set this value to a high number you may consume all ;the available process stack and eventually crash PHP (due to reaching the ;stack size limit imposed by the Operating System). ; http://PHP.net/pcre.recursion-limit ;pcre.recursion_limit=100000 [Pdo] ; Whether to pool ODBC connections. Can be one of "strict","relaxed" or "off" ; http://PHP.net/pdo-odbc.connection-pooling ;pdo_odbc.connection_pooling=strict ;pdo_odbc.db2_instance_name [Pdo_MysqL] ; If MysqLnd is used: Number of cache slots for the internal result set cache ; http://PHP.net/pdo_MysqL.cache_size pdo_MysqL.cache_size = 2000 ; Default socket name for local MysqL connects. If empty,uses the built-in ; MysqL defaults. ; http://PHP.net/pdo_MysqL.default-socket pdo_MysqL.default_socket= [Phar] ; http://PHP.net/phar.readonly ;phar.readonly = On ; http://PHP.net/phar.require-hash ;phar.require_hash = On ;phar.cache_list = [Syslog] ; Whether or not to define the varIoUs syslog variables (eg $LOG_PID,; $LOG_CRON,etc.). Turning it off is a good idea performance-wise. In ; runtime,you can define these variables by calling define_syslog_variables(). ; http://PHP.net/define-syslog-variables define_syslog_variables = Off [mail function] ; For Win32 only. ; http://PHP.net/smtp SMTP = localhost ; http://PHP.net/smtp-port smtp_port = 25 ; For Win32 only. ; http://PHP.net/sendmail-from ;sendmail_from = [email protected] ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ; http://PHP.net/sendmail-path ;sendmail_path = ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(),even in safe mode. ;mail.force_extra_parameters = ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename mail.add_x_header = On ; The path to a log file that will log all mail() calls. Log entries include ; the full path of the script,line number,To address and headers. ;mail.log = [sql] ; http://PHP.net/sql.safe-mode sql.safe_mode = Off [ODBC] ; http://PHP.net/odbc.default-db ;odbc.default_db = Not yet implemented ; http://PHP.net/odbc.default-user ;odbc.default_user = Not yet implemented ; http://PHP.net/odbc.default-pw ;odbc.default_pw = Not yet implemented ; Controls the ODBC cursor model. ; Default: sql_CURSOR_STATIC (default). ;odbc.default_cursortype ; Allow or prevent persistent links. ; http://PHP.net/odbc.allow-persistent odbc.allow_persistent = On ; Check that a connection is still valid before reuse. ; http://PHP.net/odbc.check-persistent odbc.check_persistent = On ; Maximum number of persistent links. -1 means no limit. ; http://PHP.net/odbc.max-persistent odbc.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. ; http://PHP.net/odbc.max-links odbc.max_links = -1 ; Handling of LONG fields. Returns number of bytes to variables. 0 means ; passthru. ; http://PHP.net/odbc.defaultlrl odbc.defaultlrl = 4096 ; Handling of binary data. 0 means passthru,1 return as is,2 convert to char. ; See the documentation on odbc_binmode and odbc_longreadlen for an explanation ; of odbc.defaultlrl and odbc.defaultbinmode ; http://PHP.net/odbc.defaultbinmode odbc.defaultbinmode = 1 ;birdstep.max_links = -1 [MysqL] ; Allow accessing,from PHP's perspective,local files with LOAD DATA statements ; http://PHP.net/MysqL.allow_local_infile MysqL.allow_local_infile = On ; Allow or prevent persistent links. ; http://PHP.net/MysqL.allow-persistent MysqL.allow_persistent = On ; If MysqLnd is used: Number of cache slots for the internal result set cache ; http://PHP.net/MysqL.cache_size MysqL.cache_size = 2000 ; Maximum number of persistent links. -1 means no limit. ; http://PHP.net/MysqL.max-persistent MysqL.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. ; http://PHP.net/MysqL.max-links MysqL.max_links = -1 ; Default port number for MysqL_connect(). If unset,MysqL_connect() will use ; the $MysqL_TCP_PORT or the MysqL-tcp entry in /etc/services or the ; compile-time value defined MysqL_PORT (in that order). Win32 will only look ; at MysqL_PORT. ; http://PHP.net/MysqL.default-port MysqL.default_port = ; Default socket name for local MysqL connects. If empty,uses the built-in ; MysqL defaults. ; http://PHP.net/MysqL.default-socket MysqL.default_socket = ; Default host for MysqL_connect() (doesn't apply in safe mode). ; http://PHP.net/MysqL.default-host MysqL.default_host = ; Default user for MysqL_connect() (doesn't apply in safe mode). ; http://PHP.net/MysqL.default-user MysqL.default_user = ; Default password for MysqL_connect() (doesn't apply in safe mode). ; Note that this is generally a *bad* idea to store passwords in this file. ; *Any* user with PHP access can run 'echo get_cfg_var("MysqL.default_password") ; and reveal this password! And of course,any users with read access to this ; file will be able to reveal the password as well. ; http://PHP.net/MysqL.default-password MysqL.default_password = ; Maximum time (in seconds) for connect timeout. -1 means no limit ; http://PHP.net/MysqL.connect-timeout MysqL.connect_timeout = 60 ; Trace mode. When trace_mode is active (=On),warnings for table/index scans and ; sql-Errors will be displayed. ; http://PHP.net/MysqL.trace-mode MysqL.trace_mode = Off [MysqLi] ; Maximum number of persistent links. -1 means no limit. ; http://PHP.net/MysqLi.max-persistent MysqLi.max_persistent = -1 ; Allow accessing,local files with LOAD DATA statements ; http://PHP.net/MysqLi.allow_local_infile ;MysqLi.allow_local_infile = On ; Allow or prevent persistent links. ; http://PHP.net/MysqLi.allow-persistent MysqLi.allow_persistent = On ; Maximum number of links. -1 means no limit. ; http://PHP.net/MysqLi.max-links MysqLi.max_links = -1 ; If MysqLnd is used: Number of cache slots for the internal result set cache ; http://PHP.net/MysqLi.cache_size MysqLi.cache_size = 2000 ; Default port number for MysqLi_connect(). If unset,MysqLi_connect() will use ; the $MysqL_TCP_PORT or the MysqL-tcp entry in /etc/services or the ; compile-time value defined MysqL_PORT (in that order). Win32 will only look ; at MysqL_PORT. ; http://PHP.net/MysqLi.default-port MysqLi.default_port = 3306 ; Default socket name for local MysqL connects. If empty,uses the built-in ; MysqL defaults. ; http://PHP.net/MysqLi.default-socket MysqLi.default_socket = ; Default host for MysqL_connect() (doesn't apply in safe mode). ; http://PHP.net/MysqLi.default-host MysqLi.default_host = ; Default user for MysqL_connect() (doesn't apply in safe mode). ; http://PHP.net/MysqLi.default-user MysqLi.default_user = ; Default password for MysqLi_connect() (doesn't apply in safe mode). ; Note that this is generally a *bad* idea to store passwords in this file. ; *Any* user with PHP access can run 'echo get_cfg_var("MysqLi.default_pw") ; and reveal this password! And of course,any users with read access to this ; file will be able to reveal the password as well. ; http://PHP.net/MysqLi.default-pw MysqLi.default_pw = ; Allow or prevent reconnect MysqLi.reconnect = Off [MysqLnd] ; Enable / disable collection of general statistics by MysqLnd which can be ; used to tune and monitor MysqL operations. ; http://PHP.net/MysqLnd.collect_statistics MysqLnd.collect_statistics = On ; Enable / disable collection of memory usage statistics by MysqLnd which can be ; used to tune and monitor MysqL operations. ; http://PHP.net/MysqLnd.collect_memory_statistics MysqLnd.collect_memory_statistics = On ; Size of a pre-allocated buffer used when sending commands to MysqL in bytes. ; http://PHP.net/MysqLnd.net_cmd_buffer_size ;MysqLnd.net_cmd_buffer_size = 2048 ; Size of a pre-allocated buffer used for reading data sent by the server in ; bytes. ; http://PHP.net/MysqLnd.net_read_buffer_size ;MysqLnd.net_read_buffer_size = 32768 [OCI8] ; Connection: Enables privileged connections using external ; credentials (OCI_SYSOPER,OCI_SYSDBA) ; http://PHP.net/oci8.privileged-connect ;oci8.privileged_connect = Off ; Connection: The maximum number of persistent OCI8 connections per ; process. Using -1 means no limit. ; http://PHP.net/oci8.max-persistent ;oci8.max_persistent = -1 ; Connection: The maximum number of seconds a process is allowed to ; maintain an idle persistent connection. Using -1 means idle ; persistent connections will be maintained forever. ; http://PHP.net/oci8.persistent-timeout ;oci8.persistent_timeout = -1 ; Connection: The number of seconds that must pass before issuing a ; ping during oci_pconnect() to check the connection validity. When ; set to 0,each oci_pconnect() will cause a ping. Using -1 disables ; pings completely. ; http://PHP.net/oci8.ping-interval ;oci8.ping_interval = 60 ; Connection: Set this to a user chosen connection class to be used ; for all pooled server requests with Oracle 11g Database Resident ; Connection Pooling (DRCP). To use DRCP,this value should be set to ; the same string for all web servers running the same application,; the database pool must be configured,and the connection string must ; specify to use a pooled server. ;oci8.connection_class = ; High Availability: Using On lets PHP receive Fast Application ; Notification (FAN) events generated when a database node fails. The ; database must also be configured to post FAN events. ;oci8.events = Off ; Tuning: This option enables statement caching,and specifies how ; many statements to cache. Using 0 disables statement caching. ; http://PHP.net/oci8.statement-cache-size ;oci8.statement_cache_size = 20 ; Tuning: Enables statement prefetching and sets the default number of ; rows that will be fetched automatically after statement execution. ; http://PHP.net/oci8.default-prefetch ;oci8.default_prefetch = 100 ; Compatibility. Using On means oci_close() will not close ; oci_connect() and oci_new_connect() connections. ; http://PHP.net/oci8.old-oci-close-semantics ;oci8.old_oci_close_semantics = Off [Postgresql] ; Allow or prevent persistent links. ; http://PHP.net/pgsql.allow-persistent pgsql.allow_persistent = On ; Detect broken persistent links always with pg_pconnect(). ; Auto reset feature requires a little overheads. ; http://PHP.net/pgsql.auto-reset-persistent pgsql.auto_reset_persistent = Off ; Maximum number of persistent links. -1 means no limit. ; http://PHP.net/pgsql.max-persistent pgsql.max_persistent = -1 ; Maximum number of links (persistent+non persistent). -1 means no limit. ; http://PHP.net/pgsql.max-links pgsql.max_links = -1 ; Ignore Postgresql backends Notice message or not. ; Notice message logging require a little overheads. ; http://PHP.net/pgsql.ignore-notice pgsql.ignore_notice = 0 ; Log Postgresql backends Notice message or not. ; Unless pgsql.ignore_notice=0,module cannot log notice message. ; http://PHP.net/pgsql.log-notice pgsql.log_notice = 0 [Sybase-CT] ; Allow or prevent persistent links. ; http://PHP.net/sybct.allow-persistent sybct.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. ; http://PHP.net/sybct.max-persistent sybct.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. ; http://PHP.net/sybct.max-links sybct.max_links = -1 ; Minimum server message severity to display. ; http://PHP.net/sybct.min-server-severity sybct.min_server_severity = 10 ; Minimum client message severity to display. ; http://PHP.net/sybct.min-client-severity sybct.min_client_severity = 10 ; Set per-context timeout ; http://PHP.net/sybct.timeout ;sybct.timeout= ;sybct.packet_size ; The maximum time in seconds to wait for a connection attempt to succeed before returning failure. ; Default: one minute ;sybct.login_timeout= ; The name of the host you claim to be connecting from,for display by sp_who. ; Default: none ;sybct.hostname= ; Allows you to define how often deadlocks are to be retried. -1 means "forever". ; Default: 0 ;sybct.deadlock_retry_count= [bcmath] ; Number of decimal digits for all bcmath functions. ; http://PHP.net/bcmath.scale bcmath.scale = 0

编辑

我正在使用一个mac,并检查我的设置上面。 我也有安装PHP_MysqL.dll文件

错误文件夹如何被黑客攻击?

max_input_time的最大值是多less?

.htaccess 403如果url包含另一个htaccess文件的目录,则禁止

将.htaccess转换为Nginx(mod_rewrite)

Tomcat 8 URL重写问题

extension=PHP_MysqL.dll extension=PHP_MysqLi.dll

这是我的PHPinfo()页面

在我的页面上有三个字出现了。

编辑

好吧,我有一个截图,显示扩展目录,但是当我去那里,我没有看到任何扩展名。 可能macports安装被破坏?

mod_rewrite参数数量/反向引用限制

国防部重写假的子域名?

截断的输出使用Python瓶0.12.8作为Apache服务器上Windows下的CGI应用程序

Phusion的乘客与Ruby 1.8和1.9?

詹姆斯不拿起MysqL连接器jar

MysqL_query()不是PDO的一部分,所以你检查的DLL(这是PDO的MysqL支持的DLL)不是你应该检查的DLL。 你想检查PHP_MysqL.dll (在Linux服务器上的.so)。

但PDO绝对是访问MysqL的正确方法。 这比使用MysqL_query()好得多。

在这里阅读更多关于PHP的PDO页面

所以开始使用MysqLi_()并停止使用MysqL_()

阅读此页面上的大红色框

使用MysqLi_()或PDO

这些扩展名从/etc/PHP.d下相应的.ini文件中加载。 尝试使用它们的完整路径,例如在/etc/PHP.d/MysqL.ini中使用MysqL

延长=的/ usr / lib64下/ PHP /模块/ MysqL.so

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐