Managing & Debugging PHP on your EC2 Instance
Configuring Aptana for PHP
- Set Default Permissions for files and directories created on the server. If you will frequently be transferring PHP files, set the Default Permission for Files to 755 (rwrr-xr-x).
Aptana > Preferences > Aptana > Remote > FTP
d
- Important for Windows Users! If you are using Aptana on a Windows computer, you must configure Aptana to use Unix newline characters.
Aptana > Preferences > General > Workspace > New text file line delimiter > Other > Unix

- NOTE: the previous step won't automatically change the new line characters in your existing files.
To convert a file that has Windows line endings to use Unix line endings:
Edit > Select All
File > Convert Line Delimiters To Unix [default]
- Enable execute permission for .php files. Use Aptana to change the file access mode ("chmod"), i.e. to set the read, write, or execute permissions for a file or folder on the server.
1. In File View, navigate to the file or folder on the server (file permissions are not displayed for the file or folder on your computer).
2. Right-click the file or folder, and select Properties from the context menu.
This will display the Info tab, (shown below).
Click the checkboxes
to change the permissions on a particular file or folder.

Debugging PHP
- "500 Internal Server Error." This error is most often caused by not setting the access mode on the .php file to 755.
If the file permissions on either the .php file or its containing folder are not correct, you will see this error message when you execute the script:
- Premature end of script headers, parse error, unexpected T_STRING, etc. This error is often caused by an unterminated string in your PHP program or a missing or misplaced semicolon (;).
Errors can also be caused by uploading files from a Windows computer, which uses a different newline character than Unix uses. The problem is described in Newline Conversion.
- Apache error logs:
The following shell commands can be used to read the errors generated by your PHP scripts:
less /var/log/apache/error_log
tail /var/log/apache/error_log
grep yourDuckID /var/log/apache/error_log
- Add the following two lines in your PHP file to direct most Apache error messages to your script's standard output:
error_reporting(E_ALL);
ini_set('display_errors', '1');
Keep Aptana Current
Aptana > Help > Check for Updates