Hallo,
ich habe auf dem Betriebsystem
omnios-r151028
von der Quelle
https://pkgsrc.joyent.com/packages/S...8Q4/x86_64/All
folgende Programme installiert:
Apache 2.4.37
MySQL 5.7.24
Redis 5.0.3
PHP 7.3.1
phpMyAdmin 4.8.5
und dazu die PHP-Erweiterungen
php73-curl
php73-exif
php73-ftp
php73-iconv
php73-intl
php73-ldap
php73-pdo
php73-pdo_mysql
php73-pdo_sqlite
php73-redis3
php73-soap
Wenn ich nun die datei
/opt/local/share/httpd/htdocs/test.php:
über web-aufruf starte
bekomme ich folgende Ausgabe (Fehlermeldung):
Beim Start direkt in der Terminalconsole Läuft das Programm durch
Ausgabe:
Woran kann das liegen, dass beim Webaufruf die Erweiterungen mbstring und json nicht eingebunden werden?
Und wie kann ich das erzwingen?
ich habe auf dem Betriebsystem
omnios-r151028
von der Quelle
https://pkgsrc.joyent.com/packages/S...8Q4/x86_64/All
folgende Programme installiert:
Apache 2.4.37
MySQL 5.7.24
Redis 5.0.3
PHP 7.3.1
phpMyAdmin 4.8.5
und dazu die PHP-Erweiterungen
php73-curl
php73-exif
php73-ftp
php73-iconv
php73-intl
php73-ldap
php73-pdo
php73-pdo_mysql
php73-pdo_sqlite
php73-redis3
php73-soap
Wenn ich nun die datei
/opt/local/share/httpd/htdocs/test.php:
PHP-Code:
<?php
include '/opt/local/share/phpmyadmin/vendor/symfony/polyfill-mbstring/Mbstring.php';
use Symfony\Polyfill\Mbstring as p;
echo "<h2>PHP is Fun!</h2>", PHP_EOL;
echo "Hello world!<br>", PHP_EOL;
echo "I'm about to learn PHP!<br>", PHP_EOL;
echo "This ", "string ", "was ", "made ", "with multiple parameters.", "<br>", PHP_EOL;
echo strpos('Hello World', 'W'), "<br>", PHP_EOL;
echo "mbstring ";
if (function_exists('mb_detect_encoding')) {
echo "OK";
} else{
echo "not OK";
}
echo "<br>", PHP_EOL;
echo "json ";
if (function_exists('json_encode')) {
echo "OK";
} else{
echo "not OK";
}
echo "<br>", PHP_EOL;
echo p\Mbstring::mb_strpos('Hello World', 'W'), "<br>", PHP_EOL;
?>
Code:
http://<IP-Nummer>/test.php
Code:
PHP is Fun! Hello world! I'm about to learn PHP! This string was made with multiple parameters. 6 mbstring not OK json not OK Fatal error: Uncaught Error: Call to undefined function iconv_strpos() in /opt/local/share/phpmyadmin/vendor/symfony/polyfill-mbstring/Mbstring.php:500 Stack trace: #0 /opt/local/share/httpd/htdocs/test.php(12): Symfony\Polyfill\Mbstring\Mbstring::mb_strpos('Hel lo World', 'W') #1 {main} thrown in /opt/local/share/phpmyadmin/vendor/symfony/polyfill-mbstring/Mbstring.php on line 500
Code:
root@test:~# /opt/local/bin/php /opt/local/share/httpd/htdocs/test.php
Code:
<h2>PHP is Fun!</h2> Hello world!<br> I'm about to learn PHP!<br> This string was made with multiple parameters.<br> 6<br> mbstring OK<br> json OK<br> 6<br> root@test:~#
Woran kann das liegen, dass beim Webaufruf die Erweiterungen mbstring und json nicht eingebunden werden?
Und wie kann ich das erzwingen?
Kommentar