php: increase memory limit
Categories: php, unix, apache2
errors like ‘allowed memory size of x bytes exhausted’ or ‘zero size reply’ usually means there’s not enough memory allocated for php. you need to increase the value.
if you have admin access, you can edit /etc/php.ini, locate and update ‘memory_limit’ to values like 16M, 32M, 64M. this change is global to the system. restart apache after update.
if not, add this in php script:
PHP:
ini_set("memory_limit", "32M"); |
2008-10-31 10:21:59 • Link • Comments • Trackbacks
ubuntu server: setup website
Categories: apache2
copy files to destined directory.
go to /etc/apache2/sites-availabe, edit the ’site’ file. the default is ‘default‘.
if creating a new site file, after creating and editing the file, run sudo a2ensite file. to disable the site, run sudo a2dissite file.
after the site file is edited and saved. run sudo /etc/init.d/apache2 restart.
now use the browser to go to the website. it should be there.
editing the site file
add <VirtualHost> tag for the new site. the content:
Code:
<VirtualHost *> | |
ServerAdmin email_address | |
ServerName domain.com | |
ServerAlias *.domain.com | |
| |
DocumentRoot /full/path/to/your/website | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride None | |
</Directory> | |
| |
ErrorLog /var/log/apache2/error.domain.log | |
| |
# Possible values include: debug, info, notice, warn, error, crit, | |
# alert, emerg. | |
LogLevel warn | |
| |
CustomLog /var/log/apache2/access.domain.log combined | |
ServerSignature On | |
</VirtualHost> |
some explanations
2 - any server problem will report to this email address (not sure if this works, but that’s what official doc says).
3 - website domain
4 - any prefix to the domain will be directed here. eg www.domain.com or anything.domain.com.
6 - the full path to your website.
12 - where errors are log. by default it’s error.log. add a name to distinguish which site the error comes from. this is purely personal preference.
18 - where access to the site are logged. file name, same reason as above.
for further detail, read this.
2008-03-22 16:14:38 • Link • Comments • Trackbacks
