<?php
$kasutaja = 'oleksandrbohatyrov';
$serverinimi = 'localhost';
$parool = '123456';
$andmebaas = 'oleksandrbohatyrov';
$yhendus = new mysqli($serverinimi, $kasutaja, $parool, $andmebaas);
$yhendus->set_charset('UTF8');
?>
Fatal error: Uncaught Error: Class "mysqli" not found in C:\Users\bogat\Documents\site\JSleht\Content\andmebaas\conf.php:6 Stack trace: #0 {main} thrown in C:\Users\bogat\Documents\site\JSleht\Content\andmebaas\conf.php on line 6
extension_dir = ./ext
extension_dir = C:/xampp/php/ext
C:\xampp\php\php.ini
extension=curl
;extension=ffi
;extension=ftp
extension=fileinfo
;extension=gd
extension=gettext
;extension=gmp
;extension=intl
;extension=imap
extension=mbstring
extension=exif ; Must be after mbstring as it depends on it
extension=mysqli
;extension=oci8_12c ; Use with Oracle Database 12c Instant Client
;extension=oci8_19 ; Use with Oracle Database 19 Instant Client
;extension=odbc
;extension=openssl
;extension=pdo_firebird
extension=pdo_mysql
;extension=pdo_oci
;extension=pdo_odbc
;extension=pdo_pgsql
extension=pdo_sqlite
;extension=pgsql
;extension=shmop
; The MIBS data available in the PHP distribution must be installed.
; See https://www.php.net/manual/en/snmp.installation.php
;extension=snmp
;extension=soap
;extension=sockets
;extension=sodium
;extension=sqlite3
;extension=tidy
;extension=xsl
;extension=zip
;zend_extension=opcache
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;
asp_tags=Off
display_startup_errors=On
track_errors=Off
y2k_compliance=On
allow_call_time_pass_reference=Off
safe_mode=Off
safe_mode_gid=Off
safe_mode_allowed_env_vars=PHP_
safe_mode_protected_env_vars=LD_LIBRARY_PATH
error_log="C:\xampp\php\logs\php_error_log"
register_globals=Off
register_long_arrays=Off
magic_quotes_gpc=Off
magic_quotes_runtime=Off
magic_quotes_sybase=Off
extension=php_openssl.dll
extension=php_ftp.dll
extension=php_mysql.dll
extension_dir = "C:/myphp/ext"
extension=C:/php/ext/php_mysql.dll
extension=C:/php/ext/php_mysqli.dll
extension_dir = ./ext
extension_dir = C:/xampp/php/ext
php -m
из каталога C:/xampp/php/
Module Settings
C:\WINDOWS\system32>cd C:/xampp/php/
C:\xampp\php>php -m
PHP Warning: PHP Startup: Unable to load dynamic library 'php_mysql.dll' (tried: C:/xampp/php/ext\php_mysql.dll (Не найден указанный модуль), C:/xampp/php/ext\php_php_mysql.dll.dll (Не найден указанный модуль)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'php_mysql.dll' (tried: C:/xampp/php/ext\php_mysql.dll (Не найден указанный модуль), C:/xampp/php/ext\php_php_mysql.dll.dll (Не найден указанный модуль)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/php/ext/php_mysql.dll' (tried: C:/php/ext/php_mysql.dll (Не найден указанный модуль), C:/xampp/php/ext\php_C:/php/ext/php_mysql.dll.dll (Не найден указанный модуль)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:/php/ext/php_mysql.dll' (tried: C:/php/ext/php_mysql.dll (Не найден указанный модуль), C:/xampp/php/ext\php_C:/php/ext/php_mysql.dll.dll (Не найден указанный модуль)) in Unknown on line 0
PHP Warning: Module "mysqli" is already loaded in Unknown on line 0
Warning: Module "mysqli" is already loaded in Unknown on line 0
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
random
readline
Reflection
session
extension=php_mysql.dll
extension_dir = "C:/myphp/ext"
extension=C:/php/ext/php_mysql.dll
extension=C:/php/ext/php_mysqli.dll
extension_dir
проверить, и если с первым вариантом (./ext
) работает, то оставить его, а если нет, то второй var_dump(get_loaded_extensions());
array(28) { [0]=> string(4) "Core" [1]=> string(6) "bcmath" [2]=> string(8) "calendar" [3]=> string(5) "ctype" [4]=> string(4) "date" [5]=> string(6) "filter" [6]=> string(4) "hash" [7]=> string(5) "iconv" [8]=> string(4) "json" [9]=> string(3) "SPL" [10]=> string(4) "pcre" [11]=> string(6) "random" [12]=> string(8) "readline" [13]=> string(10) "Reflection" [14]=> string(7) "session" [15]=> string(8) "standard" [16]=> string(7) "mysqlnd" [17]=> string(9) "tokenizer" [18]=> string(4) "zlib" [19]=> string(6) "libxml" [20]=> string(3) "dom" [21]=> string(3) "PDO" [22]=> string(4) "Phar" [23]=> string(9) "SimpleXML" [24]=> string(3) "xml" [25]=> string(9) "xmlreader" [26]=> string(9) "xmlwriter" [27]=> string(10) "cli_server" }
Fatal error: Uncaught Error: Class "mysqli" not found in C:\Users\bogat\Documents\site\JSleht\Content\andmebaas\conf.php:8 Stack trace: #0 {main} thrown in C:\Users\bogat\Documents\site\JSleht\Content\andmebaas\conf.php on line 8
cli_server
и отсутствие apache2handler
и его тоже нужно перезапускать array(39) { [0]=> string(4) "Core" [1]=> string(6) "bcmath" [2]=> string(8) "calendar" [3]=> string(5) "ctype" [4]=> string(4) "date" [5]=> string(6) "filter" [6]=> string(4) "hash" [7]=> string(5) "iconv" [8]=> string(4) "json" [9]=> string(3) "SPL" [10]=> string(4) "pcre" [11]=> string(6) "random" [12]=> string(8) "readline" [13]=> string(10) "Reflection" [14]=> string(7) "session" [15]=> string(8) "standard" [16]=> string(7) "mysqlnd" [17]=> string(9) "tokenizer" [18]=> string(4) "zlib" [19]=> string(6) "libxml" [20]=> string(3) "dom" [21]=> string(3) "PDO" [22]=> string(3) "bz2" [23]=> string(9) "SimpleXML" [24]=> string(3) "xml" [25]=> string(9) "xmlreader" [26]=> string(9) "xmlwriter" [27]=> string(14) "apache2handler" [28]=> string(7) "openssl" [29]=> string(4) "curl" [30]=> string(8) "fileinfo" [31]=> string(7) "gettext" [32]=> string(8) "mbstring" [33]=> string(4) "exif" [34]=> string(6) "mysqli" [35]=> string(9) "pdo_mysql" [36]=> string(10) "pdo_sqlite" [37]=> string(4) "Phar" [38]=> string(3) "ftp" }
mysqli
вижу, но всё равно не работает? C:\xampp\php\php.exe conf.php
из C:\Users\bogat\Documents\site\JSleht\Content\andmebaas\
то ошибка будет?