[Typo3-dev] changes required for PHPSuexec to work in Typo3

Martin-Pierre Frenette typo3 at frenette.qc.ca
Mon Jun 14 22:29:50 CEST 2004


Please note that only the zipfile version will work with PHPSuexec,
since symlinks are not supported.

In my code, I have hardcoded the files to work with PHPSuexec.

Right now, at the top of many Typo3 files, there is the check :

define('PATH_thisScript',str_replace('//','/', str_replace('\\','/', 
php_sapi_name()=='cgi'||php_sapi_name()=='isapi'||php_sapi_name()=='cgi-fcgi' 
? 
$HTTP_SERVER_VARS['PATH_TRANSLATED']:$HTTP_SERVER_VARS['SCRIPT_FILENAME'])));


PHPSuexec reports that the php_sapi_name is 'cgi' YET, 'PATH_TRANSLATED' 
is not defined and SCRIPT_FILENAME needs to be used.

As such, I simply modified the =='cgi' with =='xcgi' in all the 
occurances, and it works well.

But unfortunatly, that also means that cgi installations no longer work.

I suggest to create a special include file that contains a define for 
the string 'cgi' and replace it everywhere with the define.

That way, when someone installs Typo3 on Phpsuexec, they will only need 
to change ONE define.

Right now, it is in :

- index.php
- showpic.php
- t3lib/thumbs.php
- typo3/thumbs.php
- typo3/init.php

All, there are checks in :

class.t3lib_div.php
class.t3lib_install.php

in other formats.

In my case, I search for all instances of 'cgi' and I replace them with 
'xcgi' but another method is needed for the sources to work both on 
PHPSuexec and cgi systems.


Finally ( thanks to Stanislas Rolland on that one ) the following needs 
to be added to localconf.php :


$TYPO3_CONF_VARS["BE"]["fileCreateMask"]=0744;
$TYPO3_CONF_VARS["BE"]["folderCreateMask"]=0755;

Of course, it can also be :


$TYPO3_CONF_VARS["BE"]["fileCreateMask"]=0700;
$TYPO3_CONF_VARS["BE"]["folderCreateMask"]=0711;






More information about the TYPO3-dev mailing list