Advertisement

02.25.2008 at 12:28AM PST, ID: 23189610
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

PHP 4.3.2 ftp_put problem production server

Asked by pawandavid in PHP Scripting Language, PHP Installation

Tags: , ,

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/images/test2233.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.php

this 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/test.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/images/test2233.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/httpd/modules/libphp4.so.debug" does not
 
match "/usr/lib/httpd/modules/libphp4.so" (CRC mismatch).
 
(no debugging symbols found)
(no debugging symbols found)
warning: the debug information found in
 
"/usr/lib/debug//usr/lib/libcurl.so.2.0.2.debug" 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/libcurl.so.2.0.2.debug
and
-rwxr-xr-x    1 root     root         2.0M Apr 16  2007 /usr/lib/httpd/modules/libphp4.so
-rwxr-xr-x    1 root     root         2.7M Sep 13 14:54 /usr/lib/debug/usr/lib/httpd/modules/libphp4.so.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
[+][-]02.25.2008 at 12:31AM PST, ID: 20973628

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.25.2008 at 12:37AM PST, ID: 20973655

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.25.2008 at 02:19AM PST, ID: 20974115

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.25.2008 at 04:09AM PST, ID: 20974526

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.25.2008 at 05:39AM PST, ID: 20975043

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.25.2008 at 06:09AM PST, ID: 20975310

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP Scripting Language, PHP Installation
Tags: Red Hat Enterprise Linux AS release 3 (Taroon Update 6), PHP, 4.3.2
Sign Up Now!
Solution Provided By: gbygby
Participating Experts: 2
Solution Grade: A
 
 
[+][-]02.27.2008 at 05:55AM PST, ID: 20993921

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2008 at 12:55AM PDT, ID: 22700713

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]10.19.2008 at 04:35AM PDT, ID: 22751701

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628