473,378 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

using fopen with PUT method - failing to open resource

1
I've got a script that is receiving a PUT request from a Java Applet.

To access the PUT data, the php script contains:

[php]
$putdata = fopen("php://input","r");
error_log("PUTDATA = $putdata Last Err: $php_errormsg");[/php]

On our development server, it works fine (Mac OS X 10.3.9 with PHP 4.3.6)

On our production server (Linux with Ensim CP & PHP 4.2.2), the resource isn't being created.

On the develoment server, when it works correctly the error_log contains:
[Tue Aug 15 14:34:41 2006] [error] PUTDATA = Resource id #24 Last Err:
[Tue Aug 15 14:34:48 2006] [error] PUTDATA = Resource id #24 Last Err:
[Tue Aug 15 14:34:52 2006] [error] PUTDATA = Resource id #24 Last Err:

Which is what I expected, $put_date is a resource, and $php_errormsg is NULL. The script executes correctly and the file being sent via the PUT is received by the server.

On the production server, the error log is:
[Tue Aug 15 14:33:11 2006] [error] PHP Warning: No content-type in POST request in Unknown on line 0
[Tue Aug 15 14:33:12 2006] [error] PHP Warning: fopen("php://input", "r") - Success in /home/virtual/site4/fst/var/www/html/clientarea/slice.php on line 190
[Tue Aug 15 14:33:12 2006] [error] PUTDATA = Last Err: fopen("php://input", "r") - Success

The first two errors are from the built in Error Reporting, the last one is my user error_log. In this example, you can see that $putdata is now NULL, and $php_errormsg is now a mysterious "fopen("php://input", "r") - Success". (I really don't understand a message that says 'success' when in fact it's failing... :confused: )

As near as I can tell, I have the two php.ini files set pretty similar given that they're slightly different versions of PHP.

Also, I've confirmed that "allow_url_fopen" is ON in both config files, so that's not the problem.

I've also tried reading in binary mode:
$putdata = fopen("php://input","rb");
With equally poor results.

Any thoughts?
Aug 16 '06 #1
0 1842

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Heinz | last post by:
Hi All In a section of my code I open some other file via an URL to have that code executed like in $raw=fopen("http://webserver/some.php?aaa=$a&bbb=$b"); print "<td>$raw<td>"; This works...
10
by: pjlsr | last post by:
It's close to twenty years since I used the C language and at that time I was doing only floating point computational work, nothing with strings or reading files. I tried to use fopen in the...
2
by: Mike | last post by:
Hello, Im doing this in php5, apache Im not sure where the problem lies but I have a file <?php Class CreateXML{ public function xmlDeclaration(){ return $varxmlDec = "<?xml version='1.0'> ";...
5
by: Digital Puer | last post by:
Hi, I have a 13GB file. fopen() is failing on me. The resulting perror message is: "Value too large to be stored in data type". Can someone sugggest a solution? Do I need to use a new file library?...
4
by: Bob Bedford | last post by:
Hi all, I'm trying to pass a fopen() ressource result as a parameter. $x=fopen($filename); header('location:myfile.php?ressource='.$x); but it doesn't seem to work. How to do so ?
6
by: rfhurley | last post by:
I'm a newbie at this... I'm trying to run a PHP script from the W3C PHP tutorial, and the example shows the following code: <html> <body> <?php $file=fopen("welcome.txt","r"); ?>
25
by: subramanian100in | last post by:
Consider the following program: #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv) { if (argc != 2) { printf("Usage: <program-name<text-file>\n");
3
by: brook | last post by:
hey all - i´m new to php and having trouble writing a simple code which should create a file. here is the most simplified version: <?php $content = "my content"; $path = "test.txt";...
20
by: cscorley | last post by:
For some reason, I cannot use fopen() on the file in write mode. The file "time" is in the same directory as the .php file, with permissions set to 0766. PHP Version 5.2.5 Apache/2.2.8 code...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.