Libraries (PHP)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen
  • include [1]
  • require [2]
  • Libraries kun je meestal mbv. apt install binnenhengelen
  • Zie PHP installeren voor meer!

Casus: SoapClient (april 2019)

Windows: dll uit-commentariseren in php.ini. Linux (misschien de verkeerde library: Soap ipv. SoapClient?) [3]:

sudo apt-get install php7.0-soap 
sudo systemctl restart apache2

Debuggen (Bash)

Commando

php -i | grep -i soap

Geeft:

/etc/php/7.0/cli/conf.d/20-soap.ini,
soap
Soap Client => enabled
Soap Server => enabled
soap.wsdl_cache => 1 => 1
soap.wsdl_cache_dir => /tmp => /tmp
soap.wsdl_cache_enabled => 1 => 1
soap.wsdl_cache_limit => 5 => 5
soap.wsdl_cache_ttl => 86400 => 86400

Handig: Je ziet dat ik inderdaad de CLI-variant gebruik op dit moment.

Commando

apt-cache search php | grep -i soap

toont een overzicht van beschikbare apt-downloads met de term soap in de titel. Uitkomst:

libnusoap-php - SOAP toolkit for PHP
php-soap - SOAP module for PHP [default]
php7.0-soap - SOAP module for PHP
python-pysimplesoap - simple and lightweight SOAP Library (Python 2)
python3-pysimplesoap - simple and lightweight SOAP Library (Python 3)

Bron: https://stackoverflow.com/questions/11584426/how-do-i-enable-enable-soap-in-php-on-linux - Geweldig!

Verifiëren welke modules enabled zijn:

php -m


[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zlib

[Zend Modules]
Zend OPcache

Resultaat

Soap en/of SoapClient bleek gewoon actief te zijn en hoefde niet apart geladen te worden met require</coide> oid. - Het was weer eens gemakkelijker dan ik dacht.

Zie ook