Bug #406

Strange behaviour with PHP-CGI

Added by Michael Feinbier over 7 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2008-03-16
Priority:Should have Due date:
Assigned To:Robert Lemke % Done:

100%

Category:Object
Target version:-
PHP Version: Complexity:
Has patch: Affected Flow version:

Description

If PHP runs as a CGI, FLOW3 does strange things with the context.

By default you get this Message when calling an own package (ie /Testing)
No input file specified.

This has something to do with the default .htaccess and url-rewriting. I'll try around a little bit with that but a quick-fix is to add
cgi.fix_pathinfo = 0
to your php.ini to make the url_rewriting work

But then, the component manager tries to init wrong/non existing classes. eg

$this->aopFramework = $this->componentManager->getComponent('T3_FLOW3_AOP_Framework');

throws
'Class T3_FLOW3_AOP_Framework_AOPProxy_Development does not exist '

It seems to me, that this has something to do with the 'context'. Im not pretty sure what the 'context' is all about and thus im not sure if this is a bug or a feature.
On other Systems (PHP as apache module) this snippet works perfect.

Associated revisions

Revision 601ce936
Added by Robert Lemke over 7 years ago

Updated the .htaccess file - addresses #406.

History

#1 Updated by Robert Lemke over 7 years ago

  • Status changed from New to Needs Feedback

Hi Michael,

please post

  • what operating system you are using
  • the PHP version
  • the Apache version
  • the value of $requestPath in T3_FLOW3_MVC_Router->route() - with fixpathinfo = 1 and fixpathinfo = 0
  • a var_dump of $_SERVER

thanks.

#2 Updated by Michael Feinbier over 7 years ago

Hi robert,

what operating system you are using

cat /proc/version 
Linux version 2.4.34.1-grsec (root@imageneu) (gcc version 3.3.5-20050130 (Gentoo 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1)) #6 SMP Tue Feb 27 09:49:45 CET 2007

the PHP version

5.2.5

the Apache version

Apache/1.3 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.8f AuthPG/1.3 FrontPage/5.0.2.2635

the value of $requestPath in T3_FLOW3_MVC_Router->route() - with fixpathinfo = 1 and fixpathinfo = 0

for eg http://flow3.denkweite.de/AOPBrowser/Ajax/getComponentList it is
AOPBrowser/Ajax/getComponentList
in both versions. But i have to change the htaccess-rule from

RewriteRule ^(.*)$ index.php/$1 
to
RewriteRule ^(.*)$ index.php?/$1 

to make it work. (http://codeigniter.com/forums/viewthread/55620/#273798 - i'm not hosting on dreamhost)
> a var_dump of $_SERVER
Array
(
    [PATH] => /usr/local/bin:/usr/bin:/bin
    [DOCUMENT_ROOT] => /www/159823_33824/webseiten/feinbier/flow3
    [HTTP_ACCEPT] => text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
    [HTTP_ACCEPT_ENCODING] => gzip,deflate
    [HTTP_ACCEPT_LANGUAGE] => de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
    [HTTP_CACHE_CONTROL] => no-cache
    [HTTP_CONNECTION] => keep-alive
    [HTTP_HOST] => flow3.denkweite.de
    [HTTP_KEEP_ALIVE] => 300
    [HTTP_PRAGMA] => no-cache
    [HTTP_USER_AGENT] => Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.1.12) Gecko/20080207 Ubuntu/7.10 (gutsy) Firefox/2.0.0.12
    [PDFLIBRESOURCE] => /usr/local/fonts/pdflib.upr
    [REMOTE_ADDR] => xxx.xxx.xxx.xxx
    [REMOTE_PORT] => 41663
    [SCRIPT_FILENAME] => /www/.../flow3/info.php
    [SCRIPT_URI] => http://flow3.denkweite.de/info.php
    [SCRIPT_URL] => /info.php
    [SERVER_ADDR] => xx.xx.xx.xx
    [SERVER_ADMIN] => webmaster@xyz.de
    [SERVER_NAME] => flow3.denkweite.de
    [SERVER_PORT] => 80
    [SERVER_SOFTWARE] => Apache/1.3 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.8f AuthPG/1.3 FrontPage/5.0.2.2635
    [SWFFONTPATH] => /usr/lib/libswf/fonts/
    [UNIQUE_ID] => R9@3MX8AAAEAACvrDAI
    [GATEWAY_INTERFACE] => CGI/1.1
    [SERVER_PROTOCOL] => HTTP/1.1
    [REQUEST_METHOD] => GET
    [QUERY_STRING] => 
    [REQUEST_URI] => /info.php
    [SCRIPT_NAME] => /info.php
    [DOCROOT] => /www/.../flow3
    [DOC_ROOT] => /www/.../flow3
    [PHPRC] => ./:/etc/php.ini/5/159823/666301:/etc/php.ini/5/159823:/usr/local/php5
    [PHP_SELF] => /info.php
    [REQUEST_TIME] => 1205843761
    [argv] => Array
        (
        )

    [argc] => 0
)

I think the 'context' is a second, different bug, isnt it? On the same server i make it work to change the context to 'Testing'

$framework = new T3_FLOW3('Testing');
$framework->run();

#3 Updated by Michael Feinbier over 7 years ago

Hm is it not possible to edit own comments? :-(
So could you do me a favour an delete some infos from the _server dump which i think arent needed.
[HTTP_COOKIE]
[SERVER_ADDR] and
[REMOTE_ADDR] are values, that dont have to be public like this ;-) i forgot editing that.

Thanks!

#4 Updated by Robert Lemke over 7 years ago

  • Status changed from Needs Feedback to Resolved
  • Target version set to 18
  • % Done changed from 0 to 100

The context is not a bug. The point is that caching is disabled in 'Testing' context and therefore the problem doesn't occur.
I'd say it's resolved until someone else experiences problems again.

#5 Updated by Robert Lemke about 7 years ago

  • Target version deleted (18)

Also available in: Atom PDF