ini_set(“memory_limit”) in PHP 5.3.3 is not working at all

Most likely your sushosin updated, which changed the default of suhosin.memory_limit from disabled to 0 (which won’t allow any updates to memory_limit). On Debian, change /etc/php5/conf.d/suhosin.ini ;suhosin.memory_limit = 0 to suhosin.memory_limit = 2G Or whichever value you are comfortable with. You can find the changelog of Sushosin at http://www.hardened-php.net/hphp/changelog.html, which says: Changed the way the … Read more

How do I ignore the Perl shebang on Windows with Apache 2?

I use #!/usr/bin/perl in my scripts and configure Apache on Windows to ignore the shebang line. Add ScriptInterpreterSource Registry-Strict to your httpd.conf and set up the Windows Registry key as explained in the Apache docs. Here is what I get when I export the key: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\.pl\Shell\ExecCGI\Command] @=”c:\\opt\\perl\\bin\\perl.exe” I have been … Read more

413 Request Entity Too Large – File Upload Issue

Source: http://www.cyberciti.biz/faq/linux-unix-bsd-nginx-413-request-entity-too-large/ Edit the conf file of nginx: nano /etc/nginx/nginx.conf Add a line in the http, server or location section: client_max_body_size 100M; Doen’t use MB it will not work, only the M! Also do not forget to restart nginx systemctl restart nginx

Allow one session only at a time

I’ll suggest you to do something like this: Suppose when user “A” loges in to the “Com_1”, for the first time. Save a unique code in the database against that session, and same with the user session. At the mean time if he (user “A”) loges in again on “com_2”, then check his status in … Read more

.htaccess for cakephp

The answer is that there are 3 different .htaccess files: /var/www/app/webroot/.htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] </IfModule> /var/www/app/.htaccess <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] </IfModule> /var/www/.htaccess <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </IfModule> It’s … Read more

Need to allow encoded slashes on Apache

I kept coming across this post for another issue. Let me just explain real quick. I had the same style URL and was also trying to proxy it. Example: Proxy requests from /example/ to another server. /example/http:%2F%2Fwww.someurl.com/ Issue 1: Apache believes that’s an invalid url Solution: AllowEncodedSlashes On in httpd.conf Issue 2: Apache decodes the … Read more