wso2, wsf-php segmentation fault on script shut down - php

I'm trying to use WSO2 Web Services Framework for PHP 2.1.0 on Kubuntu 11.04 with php 5.3.5-1ubuntu7.7
I have minimal php installation, xml, xslt, lib-ssl, libaxis2c libraries:
apt-get install php5 php5-dev php5-xsl libxml2-dev libssl-dev libaxis2c
Everything went fine -- compiled, and installed, added to include path.
I see the library in php -i output:
wsf
wsf support => enabled
wsf version => 2.1.0
Directive => Local Value => Master Value
wsf.attachment_cache_dir => /tmp => /tmp
wsf.enable_attachment_caching => 0 => 0
wsf.home => /usr/lib/php5/20090626/wsf_c => /usr/lib/php5/20090626/wsf_c
wsf.log_level => 4 => 4
wsf.log_path => /tmp => /tmp
wsf.rm_db_dir => /tmp => /tmp
So I've tried to access simple web-service:
http://www.w3schools.com/webservices/tempconvert.asmx?wsdl
Like this:
$client = new WSClient(array(
'wsdl'=>'http://www.w3schools.com/webservices/tempconvert.asmx?wsdl'
));
$proxy = $client->getProxy();
$response = $proxy->CelsiusToFahrenheit(array('Celsius'=>11));
Script seems to run fine -- got wsdl, connected, parse response and I can print_r the response data:
Array
(
[CelsiusToFahrenheitResult] => 51.8
)
Then script trying to finish and falls with segmentation fault:
[Fri Apr 6 15:42:35 2012] [info] [rampart] rampart_mod shutdown
[Fri Apr 6 15:42:35 2012] [info] [rahas] Rahas module shutdown
Segmentation fault
If I'll comment the soap call, then segmentations fault will disappear.
Is there a way to eliminate this segfault? Thanks.

Which version of SSL are you using?
I've been trying to figure this out for myself as well and come across this
https://wso2.org/jira/browse/WSFPHP-467

Related

Swoole sending check_worker_exit_status() log

I have a problem while using laravel with swoole on php 8.1.Some requests finished with HTTP 408 sometimes. Then when I looked at the log file, I saw the following error.
[2022-07-29 08:59:52 $28.0] WARNING Server::check_worker_exit_status(): worker(pid=49, id=4) abnormal exit, status=0, signal=9
then I watched all the processes with "strace" command. I saw the worker killed by manager process. Logs are bellow:
ps -aux
www 54 0.0 0.9 473088 39424 ? Sl 12:40 0:00 swoole_http_server: master process
www 65 0.0 0.5 401440 21036 ? S 12:40 0:00 swoole_http_server: manager process
www 1608 0.2 1.3 427668 52384 ? S 13:19 0:00 swoole_http_server: worker process
strace.log:
54 13:27:40.909415 kill(1608, 0) = 0
54 13:27:40.909598 kill(1608, SIGKILL) = 0
1608 13:27:40.943992 +++ killed by SIGKILL +++
65 13:27:40.944275 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=1608, si_uid=1111, si_status=SIGKILL, si_utime=3840, si_stime=1000} ---
65 13:27:40.944400 rt_sigreturn({mask=[]}) = 1608
I tryed a lot of things but not fixed this problem. How can i deal it?
php -v:
PHP 8.1.8 (cli) (built: Jul 11 2022 08:30:39) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.8, Copyright (c) Zend Technologies
with Zend OPcache v8.1.8, Copyright (c), by Zend Technologies
php --ri swoole
swoole
Swoole => enabled
Author => Swoole Team <team#swoole.com>
Version => 4.8.10
Built => Jul 6 2022 13:14:29
coroutine => enabled with boost asm context
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
sockets => enabled
openssl => OpenSSL 3.0.2 15 Mar 2022
dtls => enabled
http2 => enabled
json => enabled
curl-native => enabled
pcre => enabled
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
mysqlnd => enabled
async_redis => enabled
Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 8388608 => 8388608
php artisan --version
Laravel Framework 9.21.3
uname -a
Linux 9968d896fe6c 5.15.0-41-generic #44-Ubuntu SMP Wed Jun 22 14:20:53 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
gcc -v
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.2.0-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-gBFGDP/gcc-11-11.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-gBFGDP/gcc-11-11.2.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (Ubuntu 11.2.0-19ubuntu1)

Installing php-soap on nginx with multiple php versions

I am running a few sites that has different php versions running (7.0 and 7.4)
For one of the sites, when I try to run soap code, I get:
Uncaught Error: Class 'SoapClient' not found
When I run
php -i | grep -i soap
i get the following output:
/etc/php/7.4/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
I need to install the soap for php 7.0 and I am not that familiar with linux so I would love to get some step by step instructions.
Thanks!

PHP cannot connect oracle in command line

I followed the steps to download oracle instant client and add it to PATH, add php extensions and enable it in php.ini. The basic information listed as follows:
OS: Windows 10 Enterprise x64
PHP: 7.3.30 (cli) (built: Aug 25 2021 09:48:17) ( ZTS MSVC15 (Visual C++ 2017) x64 )
Oracle instant client: instantclient-basic-windows.x64-12.1.0.2.0
php extension for oracle database: php_oci8-2.2.0-7.3-ts-vc15-x64
After all configuration done, I test the oracle connection with following code:
$conn = oci_connect("testuser", "testpassword", "testtns;
if (!$conn) {
$m = oci_error();
echo $m['message'], "\n";
exit;
}
else {
print "Connected to Oracle!";
}
// Close the Oracle connection
oci_close($conn);
The web page shows positive result: Connected to Oracle!
Then the problem comes: When I run the same code in command line environment, it shows:
<warning>PHP Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that PATH includes the directory with Oracle Instant Client libraries in Psy Shell code on line 1</warning>
Here is some PHP configruation info:
$ php --ri oci8
oci8
OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 2.2.0
Oracle Run-time Client Library Version => 0.0.0.0.0
Oracle Compile-time Instant Client Version => 12.1
Directive => Local Value => Master Value
oci8.max_persistent => -1 => -1
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20
oci8.default_prefetch => 100 => 100
oci8.old_oci_close_semantics => Off => Off
oci8.connection_class => no value => no value
oci8.events => Off => Off
Statistics =>
Active Persistent Connections => 0
Active Connections => 0
One obvious deviation is "Oracle Run-time Client Library Version => 0.0.0.0.0"
I tried the suggestion searched from google:
copy all contents of instantclient to Apache/bin directory and remove instantclient directory from PATH
But, it doesnot work.
This problem costs me almost 2 days time, but still not solved.
Make sure the path to Oracle Instant Client libraries is specified in the PATH environment variable.
If you're not sure try run where oci.dll from a command line. If it could not find the file, then it is not in the PATH.

No oci8 module in phpinfo()

I try to set up connection with oracle database, but I still can't even set up the module. I have rhel 7. 2 server, and I followed whole tutorial for setting up oracle instantclient and configured it with php. One thing I completely don't understand is that oci8 module displays after php -i execution:
oci8
OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 2.1.3
Revision => $Id: 59f993160cf983dd24bb391b68a65a17303d2dba $
Oracle Run-time Client Library Version => 12.1.0.2.0
Oracle Compile-time Instant Client Version => 12.1
Directive => Local Value => Master Value
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20
But there is no such module in phpinfo() inside the script. How to fix it?
PHP Version 7.0.13
Server Apache (httpd)
LD library path:
[![enter image description here][2]][2]
The common problem would be that LD_LIBRARY_PATH isn't set for Apache.
Try adding it to /etc/sysconfig/httpd like:
LD_LIBRARY_PATH=/full/path/to/oracle-client
If I have my versions right, this version of Apache (i) doesn't like the export keyword for setting variables (ii) requires a full path since it won't expand environment variables. If I'm wrong, try either or both of those.
There is a lot of information about setting the environment in the free Underground Oracle & PHP Manual, see, for example 'Setting Oracle Environment Variables for Apache' on p 108
You say you followed 'whole tutorial'. There are many tutorials. I'd recommend Oracle's installation instructions.
The answer is:
setsebool -P allow_execstack 1
You also can enable executable stack for only oci8.so with:
execstack -c /usr/lib64/php/modules/oci8.so
https://serverfault.com/questions/314336/centos-6-php-can-not-load-gdchart-so-and-oci8-so-compiled-by-me
make sure that the oci8.so is in the php extension folder
in centos is /usr/lib64/php/modules
in ubuntu xammp is /opt/lampp/lib/php/extensions/no-debug-non-zts-20170718
cd <extension folder >
sudo chmod 755 oci8.so
It works for me after
ps ax | grep "fpm"
check the pid of "php-fpm: master process"
sudo kill -9 <pid>
start php-fpm again
sudo service php-fpm start
inspired by https://stackoverflow.com/a/21693610/2538630

cannot get lighttpd configured to PHP 7

Apart from logging to the wrong file (the error log defined for that vhost defined last),
lighty does not let me use PHP 7. What am I missing?
cgi.fix_pathinfo is enabled in /etc/php/7.0/fpm/php.ini.
How can I make sure you're using the FastCGI-enabled version? What else should I look for?
version info (shrinked to the necessary)
> lsb_release -a
Description: Ubuntu 16.04.1 LTS
Codename: xenial
> lighttpd -v
lighttpd/1.4.35 (ssl) - a light and fast webserver
Build-Date: Apr 18 2016 15:36:10
> php -v
PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS )
> php-cgi -v
PHP 5.6.23-1+deprecated+dontuse+deb.sury.org~trusty+1 (cgi-fcgi)
> php-fpm7.0 -v
PHP 7.0.8-0ubuntu0.16.04.3 (fpm-fcgi)
lighty config file excerpt
> head -41 /etc/lighttpd/lighttpd.conf | tail -9
fastcgi.server = ( ".php" => ((
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/tmp/php.socket",
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "16",
"PHP_FCGI_MAX_REQUESTS" => "1000"
),
"broken-scriptfilename" => "enable"
)))
tryouts
If I change the socket to an invalid path, restarting lighttpd works fine; but the server is unreachable. (bind failed for: (invalid path) in the error log); so this seems like the correct config file.
Modifying /etc/lighttpd/conf-available/15-fastcgi-php.conf in the same way has no effect at all.
Changing the socket to "/var/run/php/php7.0-fpm.sock" has no effect either (php_info() still says PHP 5.6 after restarting lighty).
After changing bin-path to /usr/sbin/php-fpm7.0 , I still get no error when restarting lighttpd, but the web server is unreachable.
error log excerpt
> tail /var/log/lighttpd/error.log
(no output)
> tail /var/log/lighttpd/somevhost/error.log
2016-10-10 16:48:02: (log.c.164) server started
2016-10-10 16:48:02: (mod_fastcgi.c.1112) the fastcgi-backend /usr/sbin/php-fpm7-0 failed to start:
2016-10-10 16:48:02: (mod_fastcgi.c.1116) child exited with status 2 /usr/sbin/php-fpm7-0
2016-10-10 16:48:02: (mod_fastcgi.c.1119) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2016-10-10 16:48:02: (mod_fastcgi.c.1406) [ERROR]: spawning fcgi failed.
2016-10-10 16:48:02: (server.c.1022) Configuration of plugins failed. Going down.
update
I just uninstalled php5 hoping this would resolve the issues; but that didnĀ“t help either. Instead, I seem to have no way to get php5 back.
Tried a search engine?
https://www.google.com/?gws_rd=ssl#q=lighttpd+ubuntu+php+7
The first hit:
https://www.howtoforge.com/tutorial/installing-lighttpd-with-php7-php-fpm-and-mysql-on-ubuntu-16.04-lts/
suggests
## Start an FastCGI server for php (needs the php7.0-cgi package)
fastcgi.server += ( ".php" =>
((
"socket" => "/var/run/php/php7.0-fpm.sock",
"broken-scriptfilename" => "enable"
))
)
to go along with php.ini cgi.fix_pathinfo=1
You can follow the instructions on the page above to have Ubuntu run php7.0-fpm as a service, or you can configure lighttpd to start up the fastcgi.server backend by setting "bin-path" in the fastcgi.server definition, but do not do both.

Categories