Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: thill on February 16, 2009, 03:03:01 PM
-
Hi,
Having searched the forum, but not found a answer yet.
I have modified my php.ini in etc/e-smith/templates-custom/etc
db configuration setprop php MemoryLimit 128M
db configuration setprop php PostMaxSize 128M
db configuration setprop php UploadMaxFilesize 128M
expand-template /etc/php.ini
/etc/init.d/httpd-e-esmith restart
To chek the setting via console:
config show php
php=service
AllowUrlFopen=Off
MaxExecutionTime=7200
MemoryLimit=128M
PostMaxSize=128M
UploadMaxFilesize=128M
status=enabled
but when getting phpinfo via a phpinfo.php containing:
<?php
phpinfo();
?>
I get:
allow_url_fopen On
max_execution_time 30
memory_limit 8M
post_max_size 8M
upload_max_filesize 2M
And I'm unable to upload files larger than the 2MB limit displayed by the phpinfo.php
Would anybody pls point me in the right direction
-
Hi,
Having searched the forum, but not found a answer yet.
I have modified my php.ini in etc/e-smith/templates-custom/etc
db configuration setprop php MemoryLimit 128M
db configuration setprop php PostMaxSize 128M
db configuration setprop php UploadMaxFilesize 128M
expand-template /etc/php.ini
You do not need to create a custom template as all of them can be set using only the configuration database and the default SME Server templates:
[root@sme74test php.ini]# pwd
/etc/e-smith/templates/etc/php.ini
[root@sme74test php.ini]# grep -iRe MemoryLimit -e PostMaxSize -e UploadMaxFilesize *
20ResourceLimits: my $ml = $php{MemoryLimit} || "32M";
40DataHandling: my $ms = $php{PostMaxSize} || "20M";
60FileUploads: my $mf = $php{UploadMaxFilesize} || "10M";
[root@sme74test php.ini]#
So your first set of commands should have done the trick. Did you also check the changes were applied to the database:
db configuration show php
Did you also check that the changes are reflected in the /etc/php.ini file after regenerating the template fragment?
/etc/init.d/httpd-e-esmith restart
Depending on your SME Server version this might not be the proper command to restart your webserver, as of SME Server 7.4 IIRC you should use:
sv t httpd-e-smith
but when getting phpinfo via a phpinfo.php containing:
<?php
phpinfo();
?>
I get:
allow_url_fopen On
max_execution_time 30
memory_limit 8M
post_max_size 8M
upload_max_filesize 2M
And I'm unable to upload files larger than the 2MB limit displayed by the phpinfo.php
Would anybody pls point me in the right direction
Where have you placed the phpinfo file? How did you access this file, through a browser or using the command line PHP?
-
Follow up, a quick test on my system show that your commands should work:
[root@sme74test php.ini]# db configuration show php
php=service
AllowUrlFopen=Off
status=enabled
[root@sme74test php.ini]# cp /etc/php.ini /tmp/
[root@sme74test php.ini]# db configuration setprop php MemoryLimit 128M
[root@sme74test php.ini]# db configuration setprop php PostMaxSize 128M
[root@sme74test php.ini]# db configuration setprop php UploadMaxFilesize 128M
[root@sme74test php.ini]# db configuration show php
php=service
AllowUrlFopen=Off
MemoryLimit=128M
PostMaxSize=128M
UploadMaxFilesize=128M
status=enabled
[root@sme74test php.ini]# expand-template /etc/php.ini
[root@sme74test php.ini]# diff -u /tmp/php.ini /etc/php.ini
--- /tmp/php.ini 2009-02-16 19:28:06.000000000 +0100
+++ /etc/php.ini 2009-02-16 19:29:09.000000000 +0100
@@ -31,7 +31,7 @@
highlight.html = #000000
expose_php = On
max_execution_time = 30
-memory_limit = 32M
+memory_limit = 128M
mysql.allow_persistent = On
error_reporting = E_ALL & ~E_NOTICE
display_errors = Off
@@ -44,7 +44,7 @@
variables_order = "EGPCS"
register_globals = Off
register_argc_argv = On
-post_max_size = 20M
+post_max_size = 128M
gpc_order = "GPC"
magic_quotes_gpc = On
magic_quotes_runtime = Off
@@ -60,7 +60,7 @@
extension_dir = /usr/lib/php4
enable_dl = On
file_uploads = On
-upload_max_filesize = 10M
+upload_max_filesize = 128M
allow_url_fopen = Off
extension=eaccelerator.so
[root@sme74test php.ini]#
So I guess your webserver did not restart.
-
Hi & Thanks up front :-)
The changes were applied to the database:
[root@server ~]# db configuration show php
php=service
AllowUrlFopen=Off
MaxExecutionTime=7200
MemoryLimit=128M
PostMaxSize=128M
UploadMaxFilesize=128M
status=enabled
When I use the command:
/etc/init.d/httpd-e-esmith restart
I get a:
Restarting httpd-e-smith [ OK ]
When I use the command:
sv t httpd-e-smith
I get no reply/confirmation of httpd-e-smith restarting
the phpinfo file is placed in the /home/e-smith/files/ibays/Primary/html folder
and i access it with a browser (IE7 & Firefox)
-
Hi & Thanks up front :-)
The changes were applied to the database:
[root@server ~]# db configuration show php
php=service
AllowUrlFopen=Off
MaxExecutionTime=7200
MemoryLimit=128M
PostMaxSize=128M
UploadMaxFilesize=128M
status=enabled
When I use the command:
/etc/init.d/httpd-e-esmith restart
I get a:
Restarting httpd-e-smith [ OK ]
And the answers to my other questions?
-
Got it :-)
deleted my php.ini file located in /etc/e-smith/templates-custom/etc did a
signal-event post-upgrade
reboot
and now my phpinfo.php matches my db configuration show php & config show php
I can now upload files of up to 128M
-
Got it :-)
deleted my php.ini file located in /etc/e-smith/templates-custom/etc did a
Ah now I know what you did wrong, you should not have copied the whole file there, you should have copied the template fragment(s) you would like to modify and make the changes to the copies. These fragments will then be taken above the default ones, more information is in the template section in the SME Server Development Guide linked from the wiki.