我的php.ini扩展部分如下所示
; 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_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
; 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_sqlite3.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
我正在使用PhpStorm来托管PHP。 每当我尝试运行该功能时,我都会得到这个:
Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in **archive** Stack trace: #0 {main} thrown in **archive**
我的代码如下:
<?php
$con = mysqli_connect("localhost","root","","aula") or die(mysqli_error($con));
mysqli_query($con, 'SET NAMES utf8') or die(mysqli_error($con));
在第二行我已经收到错误。如何安装扩展程序? 提前谢谢。
答案 0 :(得分:0)
请确保在... // same code
byte[] outPdfBuffer = htmlToPdfConverter.ConvertUrl(url);
MemoryStream stream = new MemoryStream(outPdfBuffer);
Document document = new Document(stream);
document.LicenseKey = "myKey";
document.OpenAction.Action = new PdfActionJavaScript("print()");
byte[] b = document.Save();
Stream strm = new MemoryStream(b);
Response.AppendHeader("content-disposition", "inline; filename=file.pdf");
return new FileStreamResult(strm, "application/pdf");
中取消注释extension=php_mysql.dll
和extension=php_mysqli.dll
,php.in
是“改进的”MySQL库,但这并不一定意味着它取代了{{ 1}}完全。
另外请确保设置正确的php PATH环境变量。
答案 1 :(得分:0)
从
改变extension_dir =“ext”
到
extension_dir =“C:\ Apache24 \ php \ ext”
答案 2 :(得分:0)
(在Windows上工作)
我面临着同样的问题。
就我而言,问题是我将php.ini文件保存为文本文件。只要我将文本文件转换为&#34;所有文件&#34;在记事本中给了它&#34; .ini&#34;扩展,它成为&#34;配置设置文件&#34;它起作用了。
您可以通过浏览phpinfo()中已加载的配置文件行来检查是否是这种情况。如果值为“无”,则可能会遇到类似问题。
注意:我已经取消注释扩展并修复了扩展目录。