Scalability with php applications

The following methods can help improve scalability with php applications.

1) object code caching
Each time a request comes to your server for a php script, it has to go through the compiler and then execute the object code. If this is cached, the 1st step is skipped and you end up with a faster and more responsive script.
There are many object code caching packages available on the Internet (some free, some commercial):
A) Ioncube: http://www.ioncube.com/
B) Zend Encoder: http://www.zend.com/products/zend_safeguard
C) Turckl MMCache: http://freshmeat.net/projects/turck-mmcache/

2) Template systems
Template systems provide a different type of caching. Content caching. Template systems work well in a situation where there is static data on one or many of your pages that doesn’t have to be reloaded. Caching systems also provide a separation of code and html, which will not only improve completion time of the overall project, but make it easier for future improvments. Most template systems for php are available for free:
A) Smarty Templates: http://smarty.php.net/
B) Pear Templates: http://pear.php.net/package/html_template_it/redirected
C) PHP savant: http://phpsavant.com/yawiki/

3) Distributed object caching systems
The most widely used system of this type is memcached (http://www.danga.com/memcached/).
This type of system makes your overall site faster by caching the majority of your database data into a large memory pool.
an interesting excerpt from their site:
Danga Interactive developed memcached to enhance the speed of LiveJournal.com, a site which was already doing 20 million+ dynamic page views per day for 1 million users with a bunch of webservers and a bunch of database servers. memcached dropped the database load to almost nothing, yielding faster page load times for users, better resource utilization, and faster access to the databases on a memcache miss.”

4) PHP variables that can be set
variables_order = ‘GPC’
register_argc_argv = ‘Off’
register_globals = ‘Off’ (this is a good idea to keep off for security purposes as well)always_populate_raw_post_data = ‘Off’
magic_quotes_gpc = ‘Off’
Disable Error Logging. This is a good idea to keep on when you are developing your scripts, but it has been known to decrease overall performance.
Use IP address to access your database. Although this is sometimes not possible, you will get a slight boost in lookup speed if the IP address is used to access your database rather than its hostname.

5) Output Compression
Almost all browsers these days support something called gzip compression. Gzip compression can decrease the overall size of your output by up to 80%, but with a tradeoff: cpu usage will go up by around 10%. The benefit of using this compression type is the fact that not only will your bandwidth be decreased, but your pages will load faster.
enabling it in php (add the following lines to php.ini):
zlib.output_compression = Onzlib.output_compression_level = (level) (where level is 1-9. You may want to try different values to see what is best for your system).
if you are using apache, you can also enable the mod_gzip module. It is highly configurable, with the ability to modify output based on MIME types, files, or browser settings.
6) Other things that may help
when using a database, only retrieve the data that you are actually going to use. This may sound like a no-brainer, but I have often times worked on projects where the original programmer used (select * from mytable) when they could have used (select fieldIneed from mytable).
index database tables whenever possible
Learn more about this Here
specific language tricks
An interesting blog article I found mentions many interesting tricks that can be used: http://ilia.ws/archives/12-PHP-Optimization-Tricks.html
an article on zend.com about measuring performance: http://www.zend.com/zend/trick/trick-optimizing-php.php

PHP Freelance Work

Are you looking for ideas on how to start offering your PHP skills for money? Here are a few links I've come across offering PHP (and other) freelance opportunities for the aspiring entrepreneur.nb: if you end up on a page that doesn't look obviously PHP related, enter PHP as the search term.

www.elance.com

www.freelancers.net

www.rentacoder.com

www.jobvertise.com

www.allfreelancework.com

work-at-home-jobs-xcelerator.com

http://www.mojolin.com/

http://www.phpcareer.com/jobs.php

http://hotjobs.yahoo.com/jobseeker/jobsearch/search_results.html?keywords_any=php&kw=php&type=main&search_corp=1&search_agencies=1&country1=USA&page_number=1&order_by=salary&search_type_form=quick&updated_since=sixtydays&related_titles=6&intl=us&save_recent=1
http://jobsearch.monster.com/jobsearch.asp?cy=US&re=14&brd=1%2C1863&lid=&fn=&q=php&sort=rv&vw=b

http://www.totalfreelance.com/

http://www.guru.com/

listbid.com

devbistro.com

theitjobboard.com

php-freelancers.com

freelancesolutions.com

getafreelancer.com

scriptlance.com

projectsimple.com

projectlance.com

colance.com

codelance.com

freelancequotes.com

techfreelance.com

outsourcetoday.com

ukjobs.ostg.com

Freelance Work

ifreelancers.com

scriptverse.com

odesk.com

COUNTER