Libraries (PHP - Algemeen)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Belangrijkste commando's rondom bibliotheken:

  • 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

Casus: Installatie GD (nov. 2019)

sudo apt install php-gd

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libjbig0 libjpeg-turbo8 libjpeg8 libtiff5 libwebp6
  libxpm4 php7.2-gd
Suggested packages:
  libgd-tools
The following NEW packages will be installed:
  fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libjbig0 libjpeg-turbo8 libjpeg8 libtiff5 libwebp6
  libxpm4 php-gd php7.2-gd
0 upgraded, 12 newly installed, 0 to remove and 0 not upgraded.
Need to get 1892 kB of archives.
After this operation, 6237 kB of additional disk space will be used.
Do you want to continue? [Y/n] 

...

+ herstarten van Apache (a2re)

Resultaat

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

Zie ook