Index > Contao core > Check tool for safe mode hack (SMH)
People somtimes struggle to find the correct settings for the Safe Mode Hack (SMH). To help track down the issues, I have created a small check which you can find in the extension repository. For manual installation please download and unpack the package to a local disk, then upload the file smhcheck.php to your TYPOlight folder (there where you also have index.php and flash.php of TYPOlight).
Execute the tool by calling yoururl/smhcheck.php, for example http://www.yourdomain.com/smhcheck.php
In case the SMH is not yet activated you will get instructions:

When all settings of SMH are correct, you should get a log similar below:

Other things to check:
Execute the tool by calling yoururl/smhcheck.php, for example http://www.yourdomain.com/smhcheck.php
In case the SMH is not yet activated you will get instructions:
When all settings of SMH are correct, you should get a log similar below:
Other things to check:
- Make sure your firewalls on server and client are not blocking FTP access. You might be able to upload files in your normal ftp program with SFTP (port 22), but the SMH will only work with normal FTP (port 21) so try that too. (You may want to disable the firewalls temporarly for a quick check in case.)
Peter - "May the the TYPOlight shine on you"
2008-11-05 17:36
Thank you for this contribution, Peter. It basically extends the built-in Safe Mode Hack check (typolight/ftp.php).
2008-11-05 21:12
Oh, I wasn't aware about that at all.
But nice to learn something new about TL every now and then.
"My" check tool does some more tests to track down issues with directory permissions and tmp setups. Feel free to use whatever you want in case you rather have ftp.php extended instead of yet another tool.
"My" check tool does some more tests to track down issues with directory permissions and tmp setups. Feel free to use whatever you want in case you rather have ftp.php extended instead of yet another tool.
Peter - "May the the TYPOlight shine on you"
2008-11-05 21:24
Hmm, I haven't really thought about this Safe Mode problem until know.
I tried your tool and it shows correctly that I have not enabled the Safe Mode Hack on my installation of Typolight. I know that the server i'm using has safemode=on. But the thing is that I have no problems with my installation... The liveupdate also works without problem.
So is the safe mode hack necessary? Or will I get some problems in the future not having enabled the safe mode hack?
I tried your tool and it shows correctly that I have not enabled the Safe Mode Hack on my installation of Typolight. I know that the server i'm using has safemode=on. But the thing is that I have no problems with my installation... The liveupdate also works without problem.
So is the safe mode hack necessary? Or will I get some problems in the future not having enabled the safe mode hack?
2008-11-05 23:22
If everything works ok, there is no urge to use SMH. Should you discover later that some feature does not work properly you can always start using the SMH; it might require some additional steps to get user/group/chmods back in order though.
The TYPOlight check tool will suggest if you should use SMH or not.
The TYPOlight check tool will suggest if you should use SMH or not.
Peter - "May the the TYPOlight shine on you"
2008-11-05 23:34
Tried the check tool and the tests were ok. Creating the directory and the file were successful. But since the safe mode is on the tools says that i'll likely not be able to run typolight.
But everything seems to work fine so far. Guess if i'll run into problems later, this could be the cause..
But everything seems to work fine so far. Guess if i'll run into problems later, this could be the cause..
2008-11-05 23:51
Unfortunately I can not manage to add the right ftp path, what is the right format?
I checked the ftp path via <?php echo $_SERVER['DOCUMENT_ROOT']; ?> but the result (/kunden/homepages/4/d105495875/htdocs/tl) did not match. Even without the dash at the start and without the tl at the end. Do you have clue how to get to the right ftp path?
I checked the ftp path via <?php echo $_SERVER['DOCUMENT_ROOT']; ?> but the result (/kunden/homepages/4/d105495875/htdocs/tl) did not match. Even without the dash at the start and without the tl at the end. Do you have clue how to get to the right ftp path?
2009-01-20 22:48
I keep getting the error "FTP path seems not to be correct; temporary file not found"
The build in TYPOlight FTP check tells me that everything works fine?
When I log into FTP with settings entered in my config file i see two folders "temp" and "public_html". TYPOlight is inside the folder "public_html".
What am I doing wrong here..?
Code:
FTP host = xxxxx.dk FTP username = xxxxxx FTP password = ****** (hidden for security) FTP TL-path = public_html/ System temporary dir: /var/tmp Checking tmpfile() ... success! Creating TYPOlight temporary file system/tmp/c4ee9bd0d58728f5cbe15f570a80ab7a ... success! Connecting to FTP server ... success! Login with FTP username and password to server ... success! Check for correct directory ... FTP path seems not to be correct; temporary file not found. Please fix the SMH settings in system/config/localconfig.php, and then retry.
The build in TYPOlight FTP check tells me that everything works fine?
When I log into FTP with settings entered in my config file i see two folders "temp" and "public_html". TYPOlight is inside the folder "public_html".
What am I doing wrong here..?
2009-02-02 20:50
Same problem here...
I also discovered the following:
My webroot ( "www" ) is shown as a symlink in my ftp-root.
In any FTP client I just give "www" as the directory to go to after connect.
So in TL I gave SMH this path: www/
But it wouldn't save the changes to localconfig.php
I changed it to /www/
Now it seems to work, I am just not sure if is correct to put in a leading slash?
I also discovered the following:
My webroot ( "www" ) is shown as a symlink in my ftp-root.
In any FTP client I just give "www" as the directory to go to after connect.
So in TL I gave SMH this path: www/
But it wouldn't save the changes to localconfig.php
I changed it to /www/
Now it seems to work, I am just not sure if is correct to put in a leading slash?
2009-02-10 12:49
Since there are so many different ways a server can be configured, on some a leading slash may be required and on other not. The only thing valid allways is that there should be a slash at the end.
Peter - "May the the TYPOlight shine on you"
2009-02-10 21:24
Fraym:
Unfortunately I can not manage to add the right ftp path, what is the right format?
I checked the ftp path via <?php echo $_SERVER['DOCUMENT_ROOT']; ?> but the result (/kunden/homepages/4/d105495875/htdocs/tl) did not match. Even without the dash at the start and without the tl at the end. Do you have clue how to get to the right ftp path?
You probably can not use this path because your provider actually uses a permanent link to that directory.
The reason is that when they add/change servers this path will change and all the clients would have to update their installations.
Just ask them what the correct path looks like.
Thats at least the case with my provider.
Besides, smhcheck will still show me the same "path seems not to be correct", like stefanjohannsen described.
Any ideas?
2009-02-11 13:10
Edit:
Found Solution, with Provider W3W the "www" folder needs chmod 715. Contact Support to do this.
smhcheck is still not able to complete writing operation though.
Found Solution, with Provider W3W the "www" folder needs chmod 715. Contact Support to do this.
smhcheck is still not able to complete writing operation though.
Last edited by sgr, 2009-02-13 18:51
2009-02-11 13:22
Hi,
this is my first post here, I'm a very enthusiastic TYPOlight user.
I have the following problem on a webspace with safe mode activated. TYPOlight installation is directly under / in ftp, but I always get the following error messages. I tried an empty field as Path, I tried "." and "/", always the same error.
Uploading files, copying templates etc. works all fine. The only thing I found that TYPOlight is not able to create thumbnail pictures, neither in file manager in the backend nor in frontend.
Is this a known bug or should I always install TYPOlight in a subdirectory (I didn't try that).
Greetings
tomy
this is my first post here, I'm a very enthusiastic TYPOlight user.
I have the following problem on a webspace with safe mode activated. TYPOlight installation is directly under / in ftp, but I always get the following error messages. I tried an empty field as Path, I tried "." and "/", always the same error.
Code:
FTP host = xxxxxxxxxx.de FTP username = xxxxxxxxxxxx FTP password = ****** (hidden for security) FTP TL-path = Warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/kunden/webs/hammerwirt/:/tmp/) in /var/kunden/webs/hammerwirt/smhcheck.php on line 34System temporary dir: Checking tmpfile() ... Warning: tmpfile() [function.tmpfile]: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/kunden/webs/hammerwirt/:/tmp/) in /var/kunden/webs/hammerwirt/smhcheck.php on line 73success! Creating TYPOlight temporary file system/tmp/e3b421fb1121471b510e633a44f61d24 ... success! Connecting to FTP server ... success! Login with FTP username and password to server ... success! Check for correct directory ... Warning: ftp_nlist() [function.ftp-nlist]: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/kunden/webs/hammerwirt/:/tmp/) in /var/kunden/webs/hammerwirt/smhcheck.php on line 96 Warning: ftp_nlist() [function.ftp-nlist]: Unable to create temporary file. Check permissions in temporary files directory. in /var/kunden/webs/hammerwirt/smhcheck.php on line 96 FTP path seems not to be correct; temporary file not found. Please fix the SMH settings in system/config/localconfig.php, and then retry.
Uploading files, copying templates etc. works all fine. The only thing I found that TYPOlight is not able to create thumbnail pictures, neither in file manager in the backend nor in frontend.
Is this a known bug or should I always install TYPOlight in a subdirectory (I didn't try that).
Greetings
tomy
2009-02-13 12:47
problems with thumbs is most likely caused by wrong permission on the folder html.
2009-02-15 01:02
Sorry what is my problem. I obtain following response smh check
Warning: fopen(/is/htdocs/wp1055248_79J84L33QP/www/typo/system/tmp/6a3c568b32f006bf931d51c1d08bd27a) [function.fopen]: failed to open stream: Permission denied in /is/htdocs/wp1055248_79J84L33QP/www/typo/system/libraries/FTP.php on line 109
Warning: stream_get_meta_data(): supplied argument is not a valid stream resource in /is/htdocs/wp1055248_79J84L33QP/www/typo/system/libraries/FTP.php on line 120
TYPOlight Safe Mode Hack (SMH) Check V1.0.1
Current settings:
FTP host = www.rozing.de
FTP username = ftp1055248-typo
FTP password = ****** (hidden for security)
FTP TL-path = www/typo/
System temporary dir: /tmp
Checking tmpfile() ... success!
Creating TYPOlight temporary file system/tmp/fced699f34fbb0b9421920158d17fe0d ...
Warning: file_put_contents(/is/htdocs/wp1055248_79J84L33QP/www/typo/system/tmp/fced699f34fbb0b9421920158d17fe0d) [function.file-put-contents]: failed to open stream: Permission denied in /is/htdocs/wp1055248_79J84L33QP/www/typo/smhcheck.php on line 81
Creation of temporary file failed. Make sure directory system/tmp is writeble by php.
Security of the tmp folder is set at 775
Suggestions?
Gerozing
Warning: fopen(/is/htdocs/wp1055248_79J84L33QP/www/typo/system/tmp/6a3c568b32f006bf931d51c1d08bd27a) [function.fopen]: failed to open stream: Permission denied in /is/htdocs/wp1055248_79J84L33QP/www/typo/system/libraries/FTP.php on line 109
Warning: stream_get_meta_data(): supplied argument is not a valid stream resource in /is/htdocs/wp1055248_79J84L33QP/www/typo/system/libraries/FTP.php on line 120
TYPOlight Safe Mode Hack (SMH) Check V1.0.1
Current settings:
FTP host = www.rozing.de
FTP username = ftp1055248-typo
FTP password = ****** (hidden for security)
FTP TL-path = www/typo/
System temporary dir: /tmp
Checking tmpfile() ... success!
Creating TYPOlight temporary file system/tmp/fced699f34fbb0b9421920158d17fe0d ...
Warning: file_put_contents(/is/htdocs/wp1055248_79J84L33QP/www/typo/system/tmp/fced699f34fbb0b9421920158d17fe0d) [function.file-put-contents]: failed to open stream: Permission denied in /is/htdocs/wp1055248_79J84L33QP/www/typo/smhcheck.php on line 81
Creation of temporary file failed. Make sure directory system/tmp is writeble by php.
Security of the tmp folder is set at 775
Suggestions?
Gerozing
2009-02-24 18:24
