Apache Error Codes
With the function below you can add your own custom actions to error statuses of Apache.
Lets say you want a custom 404 error page. You could redirect a user upon a 404 error or show a complete different layout.
/** * HTTP Protocol defined status codes * @param int $num */ function HTTPStatus($num) { static $http = array ( 100 => "HTTP/1.1 100 Continue", 101 => "HTTP/1.1 101 Switching Protocols", 200 => "HTTP/1.1 200 OK", 201 => "HTTP/1.1 201 Created", 202 => "HTTP/1.1 202 Accepted", 203 => "HTTP/1.1 203 Non-Authoritative Information", 204 => "HTTP/1.1 204 No Content", 205 => "HTTP/1.1 205 Reset Content", 206 => "HTTP/1.1 206 Partial Content", 300 => "HTTP/1.1 300 Multiple Choices", 301 => "HTTP/1.1 301 Moved Permanently", 302 => "HTTP/1.1 302 Found", 303 => "HTTP/1.1 303 See Other", 304 => "HTTP/1.1 304 Not Modified", 305 => "HTTP/1.1 305 Use Proxy", 307 => "HTTP/1.1 307 Temporary Redirect", 400 => "HTTP/1.1 400 Bad Request", 401 => "HTTP/1.1 401 Unauthorized", 402 => "HTTP/1.1 402 Payment Required", 403 => "HTTP/1.1 403 Forbidden", 404 => "HTTP/1.1 404 Not Found", 405 => "HTTP/1.1 405 Method Not Allowed", 406 => "HTTP/1.1 406 Not Acceptable", 407 => "HTTP/1.1 407 Proxy Authentication Required", 408 => "HTTP/1.1 408 Request Time-out", 409 => "HTTP/1.1 409 Conflict", 410 => "HTTP/1.1 410 Gone", 411 => "HTTP/1.1 411 Length Required", 412 => "HTTP/1.1 412 Precondition Failed", 413 => "HTTP/1.1 413 Request Entity Too Large", 414 => "HTTP/1.1 414 Request-URI Too Large", 415 => "HTTP/1.1 415 Unsupported Media Type", 416 => "HTTP/1.1 416 Requested range not satisfiable", 417 => "HTTP/1.1 417 Expectation Failed", 500 => "HTTP/1.1 500 Internal Server Error", 501 => "HTTP/1.1 501 Not Implemented", 502 => "HTTP/1.1 502 Bad Gateway", 503 => "HTTP/1.1 503 Service Unavailable", 504 => "HTTP/1.1 504 Gateway Time-out" ); header($http[$num]); } ?>
You can download this 404 error page example to play with.
How to fix ACL errors in diskutility
If you try to repair permissions and get a bunch of acls found but not expected.
To fix this some chmod commands need to be executed in the terminal.
Essentially open up a terminal and do the following:
cd / ls -le
Look at the Applications and Library folders in the listing and you should see they have specific ACLs. On one of my machines the Applications folder had 2 and the Library had one. On the other both had just one.
To remove these ACLs do the following:
sudo chmod -a# 0 "/Applications" sudo chmod -a# 0 "/Library" # etc...
If you had more than one on either directory you can execute the same command until they are gone.
How to fix “Subclipse unable to load default svn client” error in Eclipse & Aptana
I've been strugling with this error for about 20 minutes just wondering what I was doing wrong...
Well, the solution is quite simple. You have install all packages below:
SVNKit Library JNA Library CollabNet Merge Client Subclipse (Required) Subversion Client Adapter (Required) Subversion JavaHL Native Library Adapter (Required) Subversion Revision Graph
You can see the installation window below:

MantisBT (Bug Tracker) APPLICATION ERROR #401
Due I think its hard to find a solution to this error on the web I point out the solution I followed and which worked perfectly.
This error is shown when large files to fail uploading, since we upload those a lot its nice to be able to fix this issue.
The solution is on the following page: http://www.mantisbt.org/bugs/view.php?id=4850
As you can read there, you need to raise "max_allowed_packet" in my.cnf. On FreeBSD located at /etc/my.cnf
I changed it to 8M, got memory enough
Good luck with bug tracking!
E_STRICT crashes php if date.timezone is not set in php.ini
In case you use the following in your php.ini:
error_reporting = E_ALL | E_STRICT
You might notice that if you do a phpinfo() that php crashes the apache child.
Reason is a bug in php that causes an infinite loop.
You can solve this by setting "date.timezone =" to your timezone.
You can also set this in your script with ini_set() but I would go for the php.ini since thats a more permanent solution.
For a list of timezones check:
http://www.php.net/datetime
How to enable error reporting in PHP
When you are developing something new in PHP you might want to enable error reporting so you can see what is going wrong and that you are working by the strict guidelines of PHP.
With this you can enable displaying errors in your browser and you can also save it to an error log if you want.
Note for PHP5.3 and above, E_ALL includes E_STRICT so you can leave out the "| E_STRICT" part.
ini_set('display_errors', 1); ini_set('display_startup_errors', 1); ini_set('error_reporting', E_ALL | E_STRICT); # Optional ini_set('error_log', '/data/www/marius/php_error.log');
You can also use these in your php.ini if you want.
Fix write access problem for Mac OS X 10.6.x to Samba share on FreeBSD or Linux
Nothing is more irritating than not being able to copy the files you want to a share.
This problem has been bugging me since the release of Mac OS X 10.6.
The fix seems to be quite simple, I added the following to my global block in smb.conf:
[global] dos charset = UTF8 unix charset = UTF8 display charset = UTF8 unix extensions = no
Now we can work without errors again.
Ps. Don't forget to unmount and re-mount your share before the changes take effect.




