Unable to set php_value 'soap.wsdl_cache_dir'
Solution 1
I hate so trivial solutions. Finally I've found the problem and solution by myself. Leaving it here for reference for others with some pre-history.
FastCGI configuration files were taken from internet when first configuring FastCGI as I haven't used it before. Tutorials showing FastCGI configuration contained the line php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache
. I became really interested what is SOAP as I don't use it on the websites that I run on this server and this curiosity brought me the solution. Actually I don't need SOAP and simply removing that line would fix the problem I guess, but I've decided to leave it there and found out that I needed simply to install php-soap
.
yum install php-soap
For RHEL/CentOS
After restarting php-fpm
I don't get the error on respawning fpm processes.
Solution 2
You're getting that message if the directory /var/lib/php/wsdlcache
specified in your pool configuration doesn't exist and cannot created by the PHP worker either. Note that the PHP worker is not running as root, but as user apache
(which is great for security and should be kept that way!), therefore it most likely doesn't have write permissions in /var/lib
. Kepp also in mind that workers can be chrooted (your config doesn't look like you're doing it, but one can) - in that case, the directory has, of course, be inside the chroot jail.
Create that directory and modifiy the access rights so that apache
is able to read and write into it and everything should be fine.
Arman P.
Updated on June 07, 2022Comments
-
Arman P. almost 2 years
I have VPS server (CentOS 6.5) running Apache 2.2.4 and PHP-FPM (FastCGI Process Manager). Looking in php-fpm error_log I've noticed error with every spawn php-fpm child process:
WARNING: [pool www] child 24086 said into stderr: "ERROR: Unable to set php_value 'soap.wsdl_cache_dir'"
I couldn't find any info on this warning googling. Is anybody aware what does this mean and how to get rid of this warning?
UPDATE 1:
fastcgi.conf for apache:
User apache Group apache LoadModule fastcgi_module modules/mod_fastcgi.so <IfModule mod_fastcgi.c> DirectoryIndex index.php index.html index.shtml index.cgi AddHandler php5-fcgi .php # For monitoring status with e.g. Munin <LocationMatch "/(ping|status)"> SetHandler php5-fcgi-virt Action php5-fcgi-virt /php5-fcgi virtual </LocationMatch> Action php5-fcgi /php5-fcgi Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /tmp/php5-fpm.sock -pass-header Authorization </IfModule> # global FastCgiConfig can be overridden by FastCgiServer options in vhost config FastCgiConfig -idle-timeout 20 -maxClassProcesses 1
And here is the php-fpm.conf and pool configuration for php:
pid = /var/run/php-fpm/php-fpm.pid daemonize = yes ; Start a new pool named 'www'. [www] listen = /tmp/php5-fpm.sock group = apache pm = dynamic pm.max_children = 8 pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3 pm.status_path = /status ping.path = /ping catch_workers_output = yes php_admin_value[error_log] = /var/log/php-fpm/www-error.log php_admin_flag[log_errors] = on php_value[session.save_handler] = files php_value[session.save_path] = /var/lib/php/session php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache
Everything else is on defaults.
UPDATE 2:
After manually creating
/var/lib/php/wsdlcache
directory as suggested and setting permissions to 770 and owner toroot:apache
, I hoped that I won't see the error again, but unfortunately after restartingphp-fpm
process the error is there again and this becomes something really very strange.P.S. Maybe this question is more appropriate for serverfault, but generally there are more experts in php and apache configuration on stackoverflow.