Monday

MySQL and SQL Column Truncation Vulnerabilities

While SQL-Injection is one of the most discussed security problems in web applications other possible problems for SQL queries like overlong input are usually ignored although they can lead to all kinds of security problems.

This might be caused by the fact that security problems that are the result of overlong input are often buffer overflows and buffer overflows are something many web application security experts know nothing about and choose to ignore.

There are however several security problems for SQL queries that are caused by overlong input and no one talks about.

max_packet_size

In MySQL there exists a configuration option called max_packet_size which is set to one megabyte by default and controls the maximum size of a packet sent between the SQL client and server. When queries or result rows do not fit into a single packet a error is raised. This means an overlong SQL query is never sent to the server and therefore never executed.

This can lead to security problems when an attacker is able to supply long data elements that are then used in SQL queries. A good example are logging queries that combine information like the HTTP User-Agent, session ids and log messages into a large query that then does not fit into the packet anymore.

Another example from a real world application is a session table cleanup process that first selects all sessions matching certain parameters into a PHP array, then performs a multiple level cleanup and in the end all selected session ids are put into single delete query. It should be obvious that when there are many session identifiers in the table that need deletion the query gets too long. The result of this is that flooding the application with new sessions in a short time will result in no unused session being deleted later anymore.

Therefore web application developers should always ensure that they do not sent overlong data to the server. And it doesn’t matter if they use prepared statements or not.

SQL Column Truncation Vulnerabilities

When user input is not checked for its length SQL Column Truncation Vulnerabilities can arise. “SQL Column Truncation Vulnerability” is the name I use to describe security problems arising from overlong input that is truncated during insertion in the database. By default MySQL will truncate strings longer than the defined maximum column width and only emit a warning. Those warnings are usually not seen by web applications and therefore not handled at all. In MySQL the sql_mode STRICT_ALL_TABLES can be activated to turn these warnings into errors but applications will run most of the time on servers that run in the default mode and even if an application uses the stricter sql_mode it should not produce this error in the first place. Therefore a length check is required.

To understand why the truncation on insert can lead to security problems imagine the following application.

  • The application is a forum where new users can register
  • The administrator’s name is known e.g. ‘admin’
  • MySQL is used in the default mode
  • There is no application restriction on the length of new user names
  • The database column username is limited to 16 characters

A potential attacker might now try to register the name ‘admin ‘, which will fail because the ‘isAlreadyRegistered’ check will result in the SQL query.

SELECT * FROM user WHERE username='admin '

Because MySQL does not compare strings in binary mode by default more relaxed comparison rules are used. One of these relaxations is that trailing space characters are ignored during the comparison. This means the string ‘admin ‘ is still equal to the string ‘admin’ in the database. And therefore the application will refuse to accept the new user.

If the attacker however tries the username ‘admin x’ the application will search for it in the database and will not find it, because it is impossible to find a username with a length of 17 in a database field that has a 16 character limit. The application will accept the new username and insert it into the database. However the username column is to short for the full name and therefore it is truncated and ‘admin ‘ is inserted into the database.

The result of this is that the user table now contains two users that due to trailing spaces both will be returned when the SELECT query above is executed. At this point a potential security problem arises because now it depends on how the username is treated throughout the application. The following pseudocode for example is vulnerable.

$userdata = null;
if (isPasswordCorrect($username, $password)) {
$userdata = getUserDataByLogin($username);
...
}

When the previous piece of code uses the SQL query

SELECT username FROM users WHERE username = ? AND passhash = ?

to detect if the user password is correct and then does a lookup of the user data by name a security problem manifests.

SELECT * FROM users WHERE username = ?

Because the attacker created the newly created admin user he knows the correct password to pass this check. And because the real admin user is first in the table it will be returned first when the user data lookup by name is executed later.
by Stefan Esser

Wednesday

Image Crop with Javascript

MooCrop

About

MooCrop is an Image Cropping utility using the amazingly powerful mootools javascript framework. Alone it serves no practical purpose but used in conjuction with a server side script becomes a powerful image manipulation tool.

Why

Looking for a mootools solution, I searched and came up with a few existing implementations. Everything I came across were only partial implementations. Those that were more polished seemed to be sluggish and effecting the DOM needlessly in some places. I wanted a class that had a very intuitive interface and played nicely with the existing DOM and more importantly I wanted it to be fast. I came to the conclusion that developing my own would give me a better understanding of mootools and broaden my understanding of drag and drop inside the DOM.

Initially I tried using the Drag.Base class found within mootools but found this to be clumbsy for this highly specialized form of dragging. With default options a single drag is moving/resizing not one but 13 DOM elements. The dragging functionality has been optimized with this sole purpose in mind.

Features

MooCrop goal is to do only one thing (image crop ) but to do it well. With this in mind I tried to make the class as flexiable as possible for your own use.

  • Completely customizable CSS styling
  • Detects and handles multiple CSS box models
  • Allows for masking to be toggled
  • Ability to hide resize handles during drag
  • Custom events for your own modification
  • Relative based postioning rather then absolute (should handle overflow properly)
  • Works and retains layouts on floating images.
  • Resize from 8 different directions
  • Ability to set minimium size limit
  • Cleans up nicely, leaving your DOM in its original state when removed.
  • Fast!

Documentation

Arguments

element the image element you want to attach MooCrop to.

options an object. see options below

Options

maskColor css valid color value for the mask background color. default: 'black'

maskOpacity opacity value (0-1) for the masking areas. default: '.4'

handleColor css valid color value for the handle background color. default: 'blue'

handleWidth width of handles. default: '8px'

handleHeight height of handles. default: '8px'

cropBorder css valid border value for the crop area border. default: '1px dashed blue'

min an object representing the minimum size the crop box can be. default: { 'width' : 50, 'height' : 50 }

showMask a boolean flag to show or hide the masking area. default: true

showHandles a boolean flag to show or hide handles during drag. default: false

Methods

getCropInfo returns an object with the current relative coordinates of the crop area in relation to the image top left corner. object properties ( 'width','height','top','left','right','bottom' ).

removeOverlay detatches MooCrop from image and return the image to its pre MooCrop state.

Events

onBegin fired just before dragging or resizing occurs. returns [ image src, croparea, bounds, handle ] image src is the complete path of the image being cropped. croparea see getCropInfo(). bounds is a coordinates object defining the image bounds for the crop area, useful for labels ( see example below ). handle is the name of the current drag/resize event [NW,N,NE,E,SE,S,SW,W] if drag = NESW

onCrop fired during drag. returns [ image src, croparea, bounds, handle ]

onComplete fired after the drag or resize event. returns [ image src, croparea, bounds, handle ]

onDblClk fired when the crop area is double clicked. returns [image src, croparea, bounds ]

Additional Notes

MooCrop does not rely on any css within the document its all set through object initialization. In preventing issues from arising from padding and margins the target image is hidden and a div is inject before it in the DOM tree. The image is used as a background image. The box is adjusted and the offset of the background image is based on the box model.

If IE box model is being used and a border has been defined for the crop area the border will be included in the px width and height. The traditional box model will not include the border.

When using MooCrop you must attach during or after the window load event. Using domready doesn't work because the image hasn't been rendered yet.

Requirements

MooCrop has been tested with IE 6 & 7, FF 2+, Opera 9.2 and Safari 2 & 3.

Download mootools, required dependancies:

  • Core: Moo, Utility, Common
  • Native: Array, String, Function, Element, Event, Dom
  • Element: Element.Dimensions, Element.Events
  • Plugins: Hash

For your convenience:

Examples/Usage

Include mootools and MooCrop in your page header

 

Default

 new MooCrop('crop_example1');

Changing the mask

 new MooCrop('crop_example2',{
'maskColor' : '#96743f',
'maskOpacity' : '.8'
});

Changing the handles

 new MooCrop('crop_example3',{
'handleColor' : '#333333',
'handleWidth' : '10px',
'handleHeight' : '10px',
'showHandles' : true
});

Adding labels with events

 var crop4 = new MooCrop('crop_example4');

// create a container for a label
// wrapper is the container that all
//MooCrop operations are performed
var indicator = new Element('span',{
'styles' : {
'position' : 'absolute',
'display' : 'none',
'padding' : '4px',
'opacity' : '.7',
'background' : '#ffffff',
'border' : '1px solid #525252',
'font-size' : '11px'
}
}).injectInside(crop4.wrapper);

// when dragging/resizing begins show indicator
crop4.addEvent( 'onBegin' ,
function(imgsrc,crop,bound,handle){
indicator.setStyle('display' , 'block');
});

// during the event update label
crop4.addEvent('onCrop' ,
function(imgsrc,crop,bound,handle){
indicator.setStyles({
'top' : crop.bottom + 10,
'left' : crop.left
}).setText("w: "+crop.width+
" h: "+crop.height);
});

// once event is done hide label
crop4.addEvent('onComplete' , function(){
indicator.setStyle('display','none');
});

Server handling example (double click on crop area)

 var crop5 = new MooCrop('crop_example5');

crop5.addEvent('onDblClk', function(img,crop,bound){
$('cropped').src = "crop.php?w="+crop.width+"&h="+crop.height+
"&x="+crop.left+"&y="+crop.top;
});

Contact

Nathan White: < nw at nwhite.net>

Monday

Why PHP ?

If you want to use PHP in your company and your manager favours another solution, or if you are trying to convince a potential client that PHP really is a superior choice for the web, you are going to need to have a clear-cut set of reasons why you believe PHP is the superior language. This short list should help you get started:

  • PHP is cross-platform. It can be run on Windows, Linux, BSD, Mac OS X, and Solaris, as well as a variety of other platforms.
  • PHP is free. You can download the source code, use it, and even make changes to it without ever having to pay any licensing costs. You can even give away your own modified version of PHP. Note to critics: just because PHP is free, it does not mean you need to give your scripts away for free.
  • PHP is fast. In the majority of scripts beyond basic benchmarks, PHP will easily compete with both Perl and Python, and usually pull ahead of Microsoft's ASP.NET by about 10-15%. Add to that the fact that PHP code can be cached for execution, and PHP's performance is first-class.
  • PHP is capable. There are thousands of pre-written functions to perform a wide variety of helpful tasks – handling databases of all sorts (MySQL, Oracle, MS SQL, PostgreSQL, and many others), file uploads, FTP, email, graphical interfaces, generating Flash movies, and more.
  • PHP is extendable. Writing your own extension to PHP is a common and easy way to implement speed-critical functionality, and PHP's extension API is a particularly rich and flexible system.
  • PHP is reliable. As an official Apache Foundation software project, PHP is brought to you by the same people that produce Apache, the world's most popular web server.
  • PHP is easy to debug. There are a number of debuggers, both commercial and freeware, that make debugging PHP a snap.
  • PHP is supported commercially. Two of the main contributors to PHP founded a company, Zend, to sell supporting products and technical support for the language, so there is no need to worry about PHP not being supported by a big company.
  • PHP is supported by the community. There are several very popular PHP web-sites such as www.phpbuilder.com that provide user-run technical support for PHP, as well as a variety of official mailing lists to help you get answers when you need them.
  • PHP is advancing. With the release of PHP 5, PHP has introduced features that have long been waited for, including more comprehensive error handling, better object orientation, and, of course, more speed.
  • PHP is fun! As I am sure you will agree while using this book, PHP is an enjoyable language to use – very little time is spent debugging code, and there is a large selection of pre-written functions available.
main page: hudzilla.org/phpwiki/index.php?title=Selling_PHP_to_your_boss

Friday

Ultimate htaccess Examples

Heres the actual code that I use when I'm developing sites for clients

This lets google crawl the page, lets me access the whole site (24.205.23.222) without a password, and lets my client access the page WITH a password. It also allows for XHTML and CSS validation! (w3.org)

# ELITE HTACCESS FOR WEBDEVELOPERS
##############################################
AuthName "SiteName Administration"
AuthUserFile /home/sitename.com/.htpasswd
AuthType basic
Require valid-user
Order deny,allow
Deny from all
Allow from 24\.205\.23\.222
Allow from w3.org htmlhelp.com
Allow from googlebot.com
Satisfy Any

Each code snippet has been copied from htaccesselite. Additional and detailed info on each htaccess code snippet can be found at askapache.com

NOTE: Most of these snippets can be used with a Files or Filesmatch directive to only apply to certain files.

NOTE: Any htaccess rewrite examples should always begin with:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

Apache Documentation: 1.3 | 2.0 | 2.2 | Current

Make any file be a certain filetype (regardless of name or extension)

#Makes image.gif, blah.html, index.cgi all act as php
ForceType application/x-httpd-php

Redirect non-https requests to https server fixing double-login problem and ensuring that htpasswd authorization can only be entered using HTTPS

Additional https/ssl information and Apache SSL in htaccess examples

SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq "google.com"
ErrorDocument 403 https://google.com

SEO Friendly redirects for bad/old links and moved links

For single moved file

Redirect 301 /d/file.html http://www.htaccesselite.com/r/file.html

For multiple files like a blog/this.php?gh

RedirectMatch 301 /blog(.*) http://www.askapache.com/$1

different domain name

Redirect 301 / http://www.newdomain.com

Require the www

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/robots\.txt$
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

Require the www without hardcoding

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/robots\.txt$ [NC]
RewriteCond %{HTTP_HOST} !^www\.[a-z-]+\.[a-z]{2,6} [NC]
RewriteCond %{HTTP_HOST} ([a-z-]+\.[a-z]{2,6})$ [NC]
RewriteRule ^/(.*)$ http://%1/$1 [R=301,L]

Require no subdomain

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/robots\.txt$
RewriteCond %{HTTP_HOST} \.([a-z-]+\.[a-z]{2,6})$ [NC]
RewriteRule ^/(.*)$ http://%1/$1 [R=301,L]

Require no subdomain

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} \.([^\.]+\.[^\.0-9]+)$
RewriteCond %{REQUEST_URI} !^/robots\.txt$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

Redirect everyone to different site except 1 IP address (useful for web-development)

ErrorDocument 403 http://www.someothersite.com
Order deny,allow
Deny from all
Allow from 24.33.65.6

CHMOD your files

chmod .htpasswd files 640 chmod .htaccess files 644 chmod php files 600 chmod files that you really dont want people to see as 400 NEVER chmod 777, if something requires write access use 766

Variable (mod_env) Magic

Set the Timezone of the server:

SetEnv TZ America/Indianapolis

Set the Server Administrator Email:

SetEnv SERVER_ADMIN webmaste@htaccesselite.com

Turn off the ServerSignature

ServerSignature Off

Add a "en-US" language tag and "text/html; UTF-8" headers without meta tags

Article: Setting Charset in htaccess

Article: Using FilesMatch and Files in htaccess

AddDefaultCharset UTF-8
# Or AddType 'text/html; charset=UTF-8' html
DefaultLanguage en-US

Using the Files Directive


AddDefaultCharset UTF-8
DefaultLanguage en-US

Using the FilesMatch Directive (preferred)


AddDefaultCharset UTF-8
DefaultLanguage en-US

Use a custom php.ini with mod_php or php as a cgi

Article: Custom PHP.ini tips and tricks

When php run as Apache Module (mod_php) in root .htaccess SetEnv PHPRC /location/todir/containing/phpinifile When php run as CGI Place your php.ini file in the dir of your cgi’d php, in this case /cgi-bin/ htaccess might look something like this AddHandler php-cgi .php .htm Action php-cgi /cgi-bin/php5.cgi When cgi’d php is run with wrapper (for FastCGI) You will have a shell wrapper script something like this: #!/bin/sh export PHP_FCGI_CHILDREN=3 exec /user3/x.com/htdocs/cgi-bin/php5.cgi Change To #!/bin/sh export PHP_FCGI_CHILDREN=3 exec /x.com/cgi-bin/php.cgi -c /abs/path/to/php.ini

Securing directories: Remove the ability to execute scripts

Heres a couple different ways I do it

AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
Options -ExecCGI

This is cool, you are basically categorizing all those files that end in those extensions so that they fall under the jurisdiction of the -ExecCGI command, which also means -FollowSymLinks (and the opposite is also true, +ExecCGI also turns on +FollowSymLinks)

Only allow GET and PUT request methods to your server.

Options -ExecCGI -Indexes -All +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_METHOD} !^(GET|PUT)
RewriteRule .* - [F]

Processing All gif files to be processed through a cgi script

Action image/gif /cgi-bin/filter.cgi

Process request/file depending on the request method

Script PUT /cgi-bin/upload.cgi

Force Files to download, not be displayed in browser

AddType application/octet-stream .avi
AddType application/octet-stream .mpg

Then in your HTML you could just link directly to the file..

And then you will get a pop-up box asking whether you want to save the file or open it.

Show the source code of dynamic files

If you'd rather have .pl, .py, or .cgi files displayed in the browser as source rather than be executed as scripts, simply create a .htaccess file in the relevant directory with the following:

RemoveHandler cgi-script .pl .py .cgi

Dramatically Speed up your site by implementing Caching!

Article: Speed Up Sites with htaccess Caching

# MONTH

Header set Cache-Control "max-age=2592000"


# WEEK

Header set Cache-Control "max-age=604800"


# DAY

Header set Cache-Control "max-age=43200"

Prevent Files image/file hotlinking and bandwidth stealing

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?askapache.com/.*$ [NC]
RewriteRule \.(gif|jpg|swf|flv|png)$ http://www.askapache.com/feed.gif [R=302,L]

ErrorDocuments

Article: Additional ErrorDocument Info and Examples

ErrorDocument 404 /favicon.ico
ErrorDocument 403 https://secure.htaccesselite.com
ErrorDocument 404 /cgi-bin/error.php
ErrorDocument 400 /cgi-bin/error.php
ErrorDocument 401 /cgi-bin/error.php
ErrorDocument 403 /cgi-bin/error.php
ErrorDocument 405 /cgi-bin/error.php
ErrorDocument 406 /cgi-bin/error.php
ErrorDocument 409 /cgi-bin/error.php
ErrorDocument 413 /cgi-bin/error.php
ErrorDocument 414 /cgi-bin/error.php
ErrorDocument 500 /cgi-bin/error.php
ErrorDocument 501 /cgi-bin/error.php

Note: You can also do an external link, but don't do an external link to your site or you will cause a loop that will hurt your SEO.

Authentication Magic

Require password for 1 file:


AuthName "Prompt"
AuthType Basic
AuthUserFile /home/askapache.com/.htpasswd
Require valid-user

Protect multiple files:


AuthName "Development"
AuthUserFile /.htpasswd
AuthType basic
Require valid-user

Example uses of the Allow Directive:

# A (partial) domain-name
Allow from 10.1.0.0/255.255.0.0

# Full IP address
Allow from 10.1.2.3

# More than 1 full IP address
Allow from 192.168.1.104 192.168.1.205

# Partial IP addresses
# first 1 to 3 bytes of IP, for subnet restriction.
Allow from 10.1
Allow from 10 172.20 192.168.2

# network/netmask pair
Allow from 10.1.0.0/255.255.0.0

# network/nnn CIDR specification
Allow from 10.1.0.0/16

# IPv6 addresses and subnets
Allow from 2001:db8::a00:20ff:fea7:ccea
Allow from 2001:db8::a00:20ff:fea7:ccea/10

Using visitor dependent environment variables:

Article: Additional SetEnvIf examples

SetEnvIf User-Agent ^KnockKnock/2\.0 let_me_in
Order Deny,Allow
Deny from all
Allow from env=let_me_in

Allow from apache.org but deny from foo.apache.org

Order Allow,Deny
Allow from apache.org
Deny from foo.apache.org

Allow from IP address with no password prompt, and also allow from non-Ip address with password prompt:

AuthUserFile /home/www/site1-passwd
AuthType Basic
AuthName MySite
Require valid-user
Allow from 172.17.10
Satisfy Any

block access to files during certain hours of the day

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
# If the hour is 16 (4 PM) Then deny all access
RewriteCond %{TIME_HOUR} ^16$
RewriteRule ^.*$ - [F,L]

A good default example .htaccess file

I use this when I start a new site, and uncomment or delete parts of the file depending on the sites needs

# DEFAULT SETTINGS
##############################################
Options +ExecCGI -Indexes
DirectoryIndex index.php index.html index.htm

### DEFAULTS ###
ServerSignature Off
AddType video/x-flv .flv
AddType application/x-shockwave-flash .swf
AddType image/x-icon .ico
AddDefaultCharset UTF-8
DefaultLanguage en-US
SetEnv TZ America/Indianapolis
SetEnv SERVER_ADMIN webmaster@askapache.com

### FAST-CGI ###
AddHandler fastcgi-script fcgi
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php5-wrapper.fcgi



# HEADERS and CACHING
##############################################
#### CACHING ####
# YEAR

Header set Cache-Control "max-age=2592000"

# WEEK

Header set Cache-Control "max-age=604800"

# 10 minutes

Header set Cache-Control "max-age=600"

# DONT CACHE

Header unset Cache-Control




# REWRITES AND REDIRECTS
##############################################
### SEO REDIRECTS ###
Redirect 301 /2006/uncategorized/htaccesselitecom-aboutus.html http://www.^^SITE^^.^^TLD^^

### REWRITES ###
RewriteEngine On
RewriteBase /

### WORDPRESS ###
# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


# END WordPress



# AUTHENTICATION
##############################################
AuthName "askapache.com"
Require valid-user
AuthUserFile /askapache/.htpasswd
AuthType basic
by John Crowner (apachehtaccess)
evolt.org

Thursday

PHP IDE

NuSphere PhpED 5.0 Commercial
Windows
Linux
5/5
PHP Edit 2.10 Commercial
Windows
5/5
PHP Designer 2005 3.0.6 Commercial
Other
Windows
5/5
ActiveState Komodo 3.5 Commercial
Other
Windows
Unix
Linux
Other
5/5
Maguma Workbench 2.6 Commercial
Windows
Linux
Mac
5/5
Bluefish 1.0 Other
Unix
Linux
Mac
5/5
emacs 21 Freeware
Windows
Unix
Linux
Mac
Other
5/5
NuSphere Nu-Coder 1.4 Commercial
Other
Windows
5/5
Dreamweaver 8 Commercial
Windows
Mac
Other
5/5
TSW WebCoder 2005 2005 Commercial
Other
Windows
5/5
Maguma Studio Pro 1.3.X Commercial
Windows
4/5
Maguma Studio Free 1.1.0 Freeware
Windows
4/5
PHP Editor by EngInSite 3 Shareware
Commercial
Windows
4/5
PHP Eclipse 1.06a Freeware
Unix
Linux
4/5
Xored:: WebStudio 0.3.4 Freeware
Windows
Unix
Linux
Other
4/5
SciTE 1.53 Freeware
Windows
Unix
Linux
Other
4/5
VS.Php Beta 3 Commercial
Other
Windows
4/5
Macromedia HomeSite 5.5 Commercial
Windows
4/5
Kate 2.2 Freeware
Linux
4/5
TextPad 4.7.2 Freeware
Commercial
Windows
4/5
Davor's PHP Constructor 1.0 Shareware
Commercial
Windows
4/5
HTML-Kit 292 Freeware
Commercial
Windows
4/5
VIM 6.1 Freeware
Windows
Unix
Linux
4/5
PHP Expert Editor 2.5 Shareware
Commercial
Windows
4/5
DzSoft PHP Editor 1.4 Shareware
Commercial
Windows
4/5
Anjuta 1.0.1 Freeware
Unix
Linux
4/5
Edit Plus 2.11 SR-2 Shareware
Commercial
Windows
4/5
Quanta Plus 3.2.1 Freeware
Linux
4/5
Zend Studio 5 Commercial
Windows
Unix
Linux
Mac
Other
4/5
EngInSite Editor for PHP 2.2 Shareware
Commercial
Windows
4/5
Pidela 0.1 Freeware
Windows
Unix
Linux
Mac
3/5
PHP Side (Simple IDE) 0.4 Freeware
Windows
Unix
Linux
3/5
EmEditor 4.0 Freeware
Shareware
Windows
3/5
ConTEXT 0.97.4 Freeware
Windows
3/5
Roadsend Studio 1.1.1 Commercial
Windows
Unix
Linux
3/5
TruStudio 1.0.0. Freeware
Windows
Unix
Linux
Mac
3/5
PHPMaker 3.2 Shareware
Commercial
Windows
3/5
PHP backend generator 0.9 Commercial
Windows
Unix
Linux
Mac
Other
3/5
Smultron 1.0.1 Freeware
Mac
3/5
HAPedit 3.1 Freeware
Windows
3/5
Svoi.NET - PHP Edit XP 4.0 Freeware
Windows
3/5
tsWebEditor 2 Freeware
Other
Windows
3/5
BBedit 7.0 Commercial
Mac
3/5
BBedit Lite 6.1 Freeware
Mac
3/5
Cooledit 3.17.7

3/5
Nedit 5.3 Freeware
Unix
Linux
3/5
PSPad 4.3.0 Freeware
Windows
3/5
PHP Coder 3 Freeware
Windows
3/5
AceHTML Pro 5 Shareware
Commercial
Windows
3/5
Top PHP Studio v1.19.6 Shareware
Commercial
Windows
3/5
jEdit 4.1 Freeware
Windows
Unix
Linux
Mac
Other
3/5
SubEthaEdit 1.1.5 Freeware
Mac
3/5
umdev 2004 Shareware
Windows
3/5
Dev-PHP 3.0 Freeware
Windows
3/5
Crimson Editor 3.60 Freeware
Windows
3/5
PHP Processor 1.2 Shareware
Windows
3/5
Arisesoft Winsyntax 2 Freeware
Windows
2/5
SEG 1.0.1 Freeware
Windows
2/5

Wednesday

Can I run a PHP script on cron?

Yes, you can run a PHP script on cron. Look here to see how to setup your own crontab.

If your PHP scripts do not have executable permissions, 644 or -rw-r--r-- for example, then as part of the command portion of the cron line, you must specify the php interpreter and pass it the filename of the PHP script (including full path to the script from your home directory) that you want executed, like so:

28 14 * * * /usr/local/bin/php -q /myscript.phtml
6 3 20 4 * /usr/local/bin/php -q /htdocs/www/x.php

The first cron line above will run myscript.phtml located in your home directory every day at 2:28PM. The second line will run the script x.php from your /htdocs/www/ directory once a year on April 20th at 3:06AM.

When you explicitly specify the php interpreter /usr/local/bin/php your scripts need not have filenames ending in .php .phtml .php3 .php4. Conversely, if your script filenames do not end in one of those PHP extensions, then you must explicitly use the php interpreter in the command portion of your cron as above.

The -q flag suppresses HTTP header output. As long as your script itself does not send anything to stdout, -q will prevent cron from sending you an email every time the script runs. For example, print and echo send to stdout. Avoid using these functions if you want to prevent cron from sending you email.

If your PHP scripts do have executable permissions like 755 or -rwxr-xr-x and they have one of the PHP filename extensions above, then you do not need to specify the php interpreter in the command portion of your cron line, like this:

5 17 * * 2 /myscript.php

The above cron would run myscript.php in your home directory every Tuesday at 5:05PM.
courtsy: modwest.com

Eclipse - an open development platform

Eclipse is an open source community whose projects are focused on building an open development platform comprised of extensible frameworks, tools and runtimes for building, deploying and managing software across the lifecycle. A large and vibrant ecosystem of major technology vendors, innovative start-ups, universities, research institutions and individuals extend, complement and support the Eclipse platform. New to Eclipse?






Enterprise Development

Embedded + Device Development

Equinox Runtimes

Application Frameworks

Language IDE

Beyond Spot-Checking: Why LLM Applications Require Specialized Evaluation

  images generated by meta ai Building applications with Large Language Models (LLMs) feels deceptively fast at first. A single engineer can...