Hi,
I have got the following problem on production server PHP 4.3.2-40 with ftp_put php command which gives blank page after invoking this command via browser. Randomly there is an output on the page but ftp_put is not giving a proper result - so files are not uploaded.
Example:
If I parse the file directly from the box:
[root@bfb1 file_upload]# php -f test.php
this is test Connected to 217.72.X.X, for user sigma1161065
Uploaded /root/testm to 217.72.X.X as /public_html/file_upload/i
mages/test
2233.php
I got a reply (connection establieshed) and upload is done successfully.
When I run the code via browser:
http://www.exampleXXX.com/file_upload/test.phpthis is test Connected to 217.72.X.X, for user sigma1161065
Warning: ftp_put(): Unable to access /root/testm in /home/sigma1161065/public_
html/file_
upload/tes
t.php on line 30
FTP upload has failed!
user and group of the testm file belongs to sigma1161065 so there is no problem with ownership and permission for the testm file are default 644. location of the file is correct
Here is this simple code which I am using:
<?
$ftp_server="217.72.X.X";
$ftp_user_name = "sigma1161065";
$ftp_user_pass = "XXXXX";
print "this is test";
// set up basic connection
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// check connection
if (!$conn_id || !$login_result)
{
print "FTP connection has failed!";
echo "Attempted to connect to $ftp_server for user $ftp_user_name";
exit;
}
else
{
print" Connected to $ftp_server, for user $ftp_user_name \n ";
}
// upload the file
$destination_file="/public
_html/file
_upload/im
ages/test2
233.php";
$source_file="/root/testm"
;
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);
// check upload status
if (!$upload) {
echo "FTP upload has failed!";
} else {
echo "Uploaded $source_file to $ftp_server as $destination_file";
}
// close the FTP stream
ftp_close($conn_id);
?>
I have got other examples of similar code where there is no output just a blank page on browser but apache error_logs shows "segmantation fault":
[Mon Jan 28 00:59:24 2008] [warn] child process 13155 still did not exit, sending a SIGTERM
[Mon Jan 28 00:59:24 2008] [warn] child process 6293 still did not exit, sending a SIGTERM
[Mon Jan 28 00:59:24 2008] [warn] child process 9329 still did not exit, sending a SIGTERM
[Mon Jan 28 00:59:24 2008] [warn] child process 9347 still did not exit, sending a SIGTERM
[Mon Jan 28 00:59:24 2008] [warn] child process 22104 still did not exit, sending a SIGTERM
[Mon Jan 28 00:59:24 2008] [warn] child process 22428 still did not exit, sending a SIGTERM
[Mon Jan 28 00:59:24 2008] [warn] child process 22682 still did not exit, sending a SIGTERM
[Mon Jan 28 00:59:24 2008] [warn] child process 23466 still did not exit, sending a SIGTERM
I did a backtrace which revealed CRC mistmach: ( can't get more information as php was compiled --without-debug)
php info:
http://bfb1.hotchilli.net/foo.php[root@bfb1 modules]# gdb /usr/sbin/httpd
GNU gdb Red Hat Linux (6.3.0.0-1.138.el3rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i386-redhat-linux-gnu"...
(no debugging symbols found)
Using host libthread_db library "/lib/tls/libthread_db.so.
1".
(gdb)
(gdb) r -DONE_PROCESS
Starting program: /usr/sbin/httpd -DONE_PROCESS
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1218516832 (LWP 13917)]
(no debugging symbols found)
(no debugging symbols found)
---Type <return> to continue, or q <return> to quit---
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
warning: the debug information found in
"/usr/lib/debug//usr/lib/h
ttpd/modul
es/libphp4
.so.debug"
does not
match "/usr/lib/httpd/modules/li
bphp4.so" (CRC mismatch).
(no debugging symbols found)
(no debugging symbols found)
warning: the debug information found in
"/usr/lib/debug//usr/lib/l
ibcurl.so.
2.0.2.debu
g" does not match
"/usr/lib/libcurl.so.2" (CRC mismatch).
Program exited with code 01.
(gdb)
There are differences in the above mentioned files:
-rwxr-xr-x 1 root root 156K Oct 14 2005 /usr/lib/libcurl.so.2.0.2
-rwxr-xr-x 1 root root 692K Apr 13 2006 /usr/lib/debug/usr/lib/lib
curl.so.2.
0.2.debug
and
-rwxr-xr-x 1 root root 2.0M Apr 16 2007 /usr/lib/httpd/modules/lib
php4.so
-rwxr-xr-x 1 root root 2.7M Sep 13 14:54 /usr/lib/debug/usr/lib/htt
pd/modules
/libphp4.s
o.debug
after manipulation - using symbolic link to point to one coherent libcurl.so.2.0.2 and libphp4.so version still no luck and backtrace gives the same error.
recomplication of php by using the same or newer version (including the most current/stable one 5.2.5) failed after many days of trying so I had to give up. Because this is the production server I can't play with it and I am trying to search for a solution to this problem without recompilation.
I need to mention that the problem appeared after ZendOptimzer 3.3.2 installation on the box which was unsuccessful.
Any help appreciate...
Start Free Trial