Plesk, safe mode, no SuPHP

Permalink 2 users found helpful
I hope no one has to deal with such a configuration, but here would be a possible solution anyways..

On a server with plesk apache runs as user "apache". FTP operations are performed with different users/groups..

If you create a directory out of php it is owned by apache. This is annoying because safe mode doesn't allow you to write in a directory owned by apache.


- All directories have to be created manually. Basically it's about files (cache, cache_objects etc.)
- C5 creates lots of directories in files/. Has to be disabled. Not sure if there's an official way, but this works:

/concrete/libraries/file/importer.php

The method generatePrefix should look like this:
private function generatePrefix() {
      return null;
      /*
      $prefix = rand(10, 99) . time();
      return $prefix;   
      */
   }


By doing this, c5 doesn't create any directories and works fine..

Remo
 
ugeen replied on at Permalink Reply
ugeen
Work perfect and sorry fo russin slang Это ахиренно пашет!!!
I like to see this in dashboard like a option, very useful for hosting with limitation.
Remo replied on at Permalink Reply
Remo
yeah, having this as an option would be nice. Not necessarily in the dashboard, site.php would probably be good enough as well..

But for small sites, it nice if you could disable this feature with the numbered folders
ugeen replied on at Permalink Reply
ugeen
Can I, turn off cash forever. Same problems with /cashe and /cashe_objects folders.
And error
mysql error: [-32000: Cache write error]in
CacheExecute(/home/sitename/public_html/files/cache/adodb_d4aef700931fbc94185c9b3dd9fb2c40.cache,
select ctID from PageTypes)
---
every hour Connect to ftp > Clean folders
Articulon replied on at Permalink Reply
Alex,

did you ever get an answer to this? I am experienceing the same error trying to login in to a site. mysql error: [-32000: Cache write error] in CacheExecute(/home/perciostrategies.com/public_html/files/cache/cb/adodb_cbb3e0bf222e75329f995a25d9be7f15.cache, select ctID from PageTypes)

Is it a server setting?

thanks,
marnixvv replied on at Permalink Reply
marnixvv
Thanks Remo,

This fixed my problem. After deploying the site from staging to production (on a Plesk managed shared hosting account) uploading images just stopped working.
Through FTP I was able to see folders were being created which uid/gid apache but no files were stored in them.

Although this fix works, it does introduce the risk of overwriting files that have the same name. I was considering modifying the code a bit further to prefix the file name with a random number, does anybody have some thoughts on this?