############################################################################## # $Id: UAQ.txt,v 1.3 2004/02/02 15:01:01 schilz Exp $ # # Copyright (c) 2003 Dr. Thomas Schilz # # This file is part of MozPHP. # # MozPHP is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # MozPHP is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with MozPHP; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################## ------------------------------------------------------------------------------ Q: When trying to open a php document a message box appears telling me that Mozilla does not know how to handle file type text/php or that some file /tmp/... could not be saved. What's wrong? A: libphptohtml.so did not get registered. Read on with the next question. ------------------------------------------------------------------------------ Q: libphptohtml.so does not get registered when Mozilla starts after the library has been installed. Mozilla eventually crashes with a segmentation fault when trying to open a php document. What happened? A: Your libphp4.so probably depends on external symbols that cannot be resolved. Make sure that all nessecary libraries can be found when libphptohtml.so gets loaded. Try building the small pembed sample programm to find out which libraries your libphp4.so depends on. Make sure you didn't say --with-apxs when building libphp4.so, because otherwise there will be dependencies on apache internals. ------------------------------------------------------------------------------ Q: Why can't we use the "file" protocol to read .php files? A: In nsDocShell::DoURILoad POST data is only set up for http channels. So if we use "file" channels we have no way to access POST data. ------------------------------------------------------------------------------ Q: Is there no other way to access POST data? A: No. POST data is extracted in nsFormSubmission::SubmitTo (file content/html/content/src/nsFormSubmission.cpp) and the passed on to nsWebShell::OnLinkClickSync to nsDocShell::InternalLoad to nsDocShell::DoURILoad, where it's finally discarded if the channel for the protocol does not implement nsIHttpChannel. ------------------------------------------------------------------------------ Q: Why don't we use use an internal nsFileChannel instance instead of copying most of it's methods? A: nsFileChannel only accepts "file:..." URLs. If we change "cfh" to "file" for the nsFileChannel, then this scheme somehow leaks through. The result is that relative URLs are openend with the "file" protocol. ------------------------------------------------------------------------------ Q: Why is it nessecary to associate MIME type text/php with extension php? A: Under Linux, if there is no MIME type associated with .php then Mozilla tries to open .php files with type application/x-httpd-php. So we could register our stream converter as a converter from that type to text/html. But this is not the case on Windows. Mozilla on Windows displays the source of .php files in the browser window if no MIME type is associated with extension php.