Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Content type application/octet stream problems 1

Status
Not open for further replies.
Jan 4, 2002
6
US
Using apache 1.34.14
Php V4.04.4
Mysql 3.23.32

I just upgraded to these versions above. I used to be able to publish content via php web pages and use phpMyAdmin to add data to my tables via a text box and then a publish it etc.

Now when I try it instead of the data I type in I get the MIME type.

For example, I have a content management system. I can add and remove data via a php web page. I type in a message and try to publish it and instead of what I typed I get "Content Type: application/Octet Stream".

It didnt do this before I upgraded. Any ideas on how I can fix this with out trying to roll back my upgrades.

All help appreciated.

NOTE: I do have the mime type configured in my apache.conf file
 
Is your content management system new also? Or did you have to edit the script? The out put you are seeing is part of the code. For example, if a script has to pass data or contents of a file to another program like sendmail or to another file, it has a line that says something like the following:
print "Content-type: application/octet-stream\n";

What I'm thinking is that the file with that line got corrupted. Sometimes zipping a file will add carriage returns and line feeds the same goes for transfering a text file in binary mode. Another way is if you edited the file and accidently deleted a " ; " or something. For some reason it thinks it's supposed to print what's in quotes to the browsers screen. Apache should be able to serve php ver. 4.0+ out of the box. To be of more help, I'd need to know if you upgraded from tarballs or RPMs and what options did you use on the command line if you used rpm.
 
I'll check the code from the content manager. It is new, however, I have used phpMyAdmin for sometime now and it's also displaying the mime type instead of the data I type in.

I used an RPM packages for redhat 7.0 and did the upgrades via the gnome interface.
 
Here's an example of the error when trying to update a table in MySQL via phpMyAdmin. Basically I get the same type of error in the content management system. What should have been posted was an update to data in a table. Like this -> insert into table ('1', 'name', 'age'); <-

Error
SQL-query :

Content-Type: application/octet-stream

MySQL said:


You have an error in your SQL syntax near 'Content-Type: application/octet-stream' at line 1
 
That kinda goes to what I was saying in my first reply. I think you have a CRLF where it shouldn't be. Open that file with gedit (linux I hope). If you see anything that looks like little squares at the end of each line, thems would be the bad boys I'm talking about. If you're running windoze, use a pure text editor such as notepad. You should see something there too but I'm not sure. A good test is to do what you were trying to do from the command line and see if it works. If it does and you get no errors, the problem is a funky file.
 
Hi,

I rather suspect that its just a case of not defining the mime type(s) correctly. For example, if you didn't set up 'AddHandler' for .cgi files and attempted to run a script then it would set content type as whatever the DefaultType directive was - normally 'text/html' and the browser would just display the source code.

So, mime types work by a combination of server config which dictates how apache + modules handle files, and browser config which dictates what the browser (or other client s/w) does when receiving output tagged with a given mime-type.

In theory, if a mime-type is not defined in /etc/mime.types (thats redhat - or your equiv) or via an 'AddType' directive in httpd.conf then the default would be used. I can't see how things would just become tagged as application/octet-stream unless they were defined as such or that was the default. The only other way would be via mod_mime_magic --> .

Anyway, clearly something changed during the upgrade so make sure that the basics like the php config within apache are still intact. This requires mime definition to work (compared say to cgi which defines a handler).

Are you saying php still works in itself ?

Regards
 
Yes, php and works fine on the server. I'll take a look at mime_magic. I did look at the mime types via webmin for apache. It shows application/octet-stream bin dmz lzh exe class in the mime.type file. I'll check the apache.conf file and make sure its not hosed with odd characters or something like that.
 
ok. I placed the backup copy of my apache.conf file into the conf dir. Restarted apache and now it works. :)

So now I'll compare the files and see whats different.


Thanks for your help. I really appreciate it!
 
Oddly enough the only difference between the two is a virtual server I had previously configured but had removed after the upgrade.

Me thinks I deleted a bit more lines then I should have when I deleted the virtual server from the conf file. Thank god I make backups of everything.
:)
The wierd thing is that the mime types and the virtual server area are no where near each other. Oh well. I'll keep an eye on it.

Thanks again all.
 
&quot;The End Justifies the Means&quot; Who cares how ya got there! :eek:) Congrats on finding the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top