OpenWrt Forum Archive

Topic: lighttpd and php signal 10

The content of this topic has been archived on 30 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I run lighttpd 1.4.26-2 and php5 5.3.1-3 on openwrt Backfire 10.03.
If I run phpinfo.php everything goes well.

With a test.php script:

<?php
echo "<html><body>";
echo "this is a php-script<br>";
echo date('d');
echo "</body></html>";
?>

I get an error "(mod_cgi.c.1287) cleaning up CGI: process died with signal 10"

If I out comment the "date('d')" instruction, no problem.

Anyone who can help me? I only found one post with this error, but no solution...

Just tried this script on my rspro , and no problems .
Have you set Default timezone in your php.ini ?

yes, I think so. In my php.ini:

[Date]
date.timezone = "Europe/Brussels"
date.default_latitude = 51.0
date.default_longitude = 4.0

Yes, I've seen that, but no solution sad

Nobody has a clue to this problem? I have installed a swap partition (150MB), same problem

Signal 10 is a segmentation fault, php is probably just crapping out. Try running the script on the cli.

jow, what do you mean by "php is probably just crapping out"?

I'll try to install the cli and let you know...

I've installed lighttpd and php5 on an usb hd: /mnt/usb
I've run php-cgi on the cli:
root@OpenWrt:~# /mnt/usb/usr/bin/php-cgi /mnt/usb/www/test.php
Response:
X-Powered-By: PHP/5.3.1
Content-type: text/html

Bus error

In /var/log/lighttpd/error.log:
(mod_cgi.c.1287) cleaning up CGI: process died with signal 10

When I run:
root@OpenWrt:~# /mnt/usb/usr/bin/php-cgi /mnt/usb/www/phpinfo.php

everything OK (including the [date] section in phpinfo();)

I've set in php.ini:

memory_limit = 32M
date.timezone = "Europe/Brussels"

free gives me:
root@OpenWrt:~# free
                     total         used         free       shared      buffers
  Mem:        29484        27032         2452            0         7040
Swap:       152652           12       152640
Total:       182136        27044       155092

and df:
root@OpenWrt:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 1280      1280         0 100% /rom
tmpfs                    14744        80     14664   1% /tmp
tmpfs                      512         0       512   0% /dev
/dev/mtdblock3            5440      2696      2744  50% /overlay
mini_fo:/overlay          1280      1280         0 100% /
/dev/sda2             42314272    183548  39981348   0% /mnt/usb

Nobody any clue??

did you install zoneinfo-core (and probably zoneinfo-europe)? I had to install it, to be able to use date with php

I installed zoneinfo-core and zoneinfo-europe , same problem.
I tested with php5-cli. On the instruction $t=date('Y-m-d H:i:s') I get "Segmentation fault":

root@OpenWrt:~# /mnt/usb/usr/bin/php5-cli /mnt/usb/www/test.php
<html><body>this is a php-script<br>Segmentation fault

I tested also with php4-cli. Then everything went OK:

root@OpenWrt:~# /mnt/usb/usr/bin/php4-cli -c /mnt/usb/etc/php4.ini /mnt/usb/www/test.php
<html><body>this is a php-script<br>date = 2011-11-28 20:56:19</body></html>

So, can I take the conclusion that something is terribly wrong with PHP5 on Openwrt?

Next, I will try the combination lighttpd and PHP4-cgi...

How can I be sure that the zoneinfo packets (who are in /mnt/usb/usr/share/zoneinfo or /usr/share/zoneinfo) are recognised by php-cli? Do I have to change something in php.ini?

Combination of lighttpd 1.4.26-2 and php4 4.4.7-3 on openwrt Backfire 10.03 WORKS with no problem!!
Finally half a solution! Obviously without PHP5 features. But perhaps I can live with that...

PHP5 in backfire releases does not use zoneinfo packages, only trunk packages do.

OK, I installed zoneinfo only because of tip from eleon216.

Do you think installing a trunk version of backfire and/or PHP5 will be the solution to the problem?

No.

The discussion might have continued from here.