This is almost the same post as one made earlier in the fck editor/resource browser forum. It is (mostly) repeated here because of the wider issues addressed here..
Config
MODx version 0.9.6.3
Version codename rev 4565
Database Version: 4.1.22-standard
PHP: 5.2.5
On a Linux platform.
A little while ago I created a file-upload feature. I quickly ran into a maximum set within the PHP configuration, to which I don’t have access. I spoke to the hosting people who added this:
php_value upload_max_filesize 11M
php_value post_max_size 11M
php_value max_execution_time 200
php_value max_input_time 200
to the .htaccess file
Didn’t work, so they #’d out the four lines and added to the site root a file called php.ini which contained one line:
upload_max_filesize = 11M
Fine - the upload feature worked.
Next time I came to edit the site: problems. The /manager login page opened normally, I edited a page normally, but when the save icon was clicked the browser page immediately reverted to the /manager login page. Subsequent login revealed that the edit had not been successful.
Another symptom was that the /images and /files resource directories, (when opened from insert/edit image, or insert/edit link icons, and then clicking the browse icon to move to the resource browser), were blank: no thumbnails, and the upload feature failed to upload. The identical symptoms to trying to read or write to a resources file with incorrect permissions.
If I take out the one-line php.ini file from the root directory everything works normally, except that the file upload limit stays at the hosting co’s limit (2M).
So - to edit the site I remove the php.ini file, and to run the site I replace it, but it is irritating. I’ve hunted within these walls, and on the net at large, but no-one else seems to have quite this problem.
In the process of eliminating possible causes I upgraded to the latest release of MODx and re-checked all paths and file permissions. Everything is as out of the box, except that I set up for friendly URLs, as on all 10 of my MODx sites. (None of which have file-upload functionality, and all of which work fine).
I can’t even tell if this is a php thing or a MODx thing.
Any ideas anyone?
Nic Boyde
MODX Revolution 2.6.5-pl (traditional)
Hosted on MODX Cloud
Skype: nicbaldeagle
The only thing I can think of is another php.ini file higher up in the tree that’s now being ignored.
Quote from: BobRay at Jun 19, 2009, 11:42 PM
The only thing I can think of is another php.ini file higher up in the tree that’s now being ignored.
Quite possibly Bob, but not in my tree - or at least not in that part of to which I have access. Would posting the master php config.ini file help? This little php.ini file is only over-writing one line of the overall php configuration. I suspect some dark Apache quirk involving something obscure in .htaccess. If I’m right, I’m doomed.
Funnily enough, in two other (so far) MODx sites - with the same hosting firm and same LAMP set-up (and no little php.ini file) I get the first symptom (failing to save and re-presenting the login screen) if I save a huge amount of code (80 lines or so) as a snippet rather than a "one-line include=’large.php’" snippet. A behaviour I can’t find documented within this forum either.
Thanks for taking the time to think about this oddity.
MODX Revolution 2.6.5-pl (traditional)
Hosted on MODX Cloud
Skype: nicbaldeagle
Quote from: nicboyde at Jul 02, 2009, 03:38 AM
Funnily enough, in two other (so far) MODx sites - with the same hosting firm and same LAMP set-up (and no little php.ini file) I get the first symptom (failing to save and re-presenting the login screen) if I save a huge amount of code (80 lines or so) as a snippet rather than a "one-line include=’large.php’" snippet. A behaviour I can’t find documented within this forum either.
That’s truly odd since the snippet code is going into the DB and should be unrelated to upload limits. It ought to tell us something, but I can’t think what.
-
☆ A M B ☆
- 24,524 Posts
I suppose it’s possible that a large enough snippet would be bigger than the "text" field in the database allows? Since snippets are also cached in the site’s cache file, it’s generally considered good practice to keep the snippet code itself as small as possible, including most of the code from external files, to help keep the cache file (relatively) smaller.
It looks like the field that holds the code is a mediumtext field, which should hold 16,777,215 characters -- no way 80 lines would hit that limit; nor would it get near an 8M PHP memory limit.
@nicboyde: Are you seeing anything in the MODx or Apache error logs?