TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 08-10-2008, 08:33 PM   #1 (permalink)
The Wanderer
 
Join Date: Jan 2008
Posts: 21
Thanks: 0
Speeple is on a distinguished road
Asterix Tutorial Series

Hi,

I'm working on a series of blog posts on the topic of PHP optimisation.

Here's the first instalment: Compiling PHP – PHP Performance Optimization

Any feedback on technical errors etc. would be much appreciated.

Yes I know you hate my writing style as much as I do, but if there is anything especially inarticulate please let me know

- Cheers!
__________________
AKA Martin Gallagher
Speeple is offline  
Reply With Quote
Old 08-10-2008, 09:52 PM   #2 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Your example of how you compile PHP is interesting, but you don't really go into any detail on why you compile it like that. That's pretty important so people don't try and compile it the same as you and then wonder why they're missing a lot of functionality - for example, and I may be incorrect about what this is doing, but you seem to be turning off a lot of VERY important/useful features, such as PDO, hash, session functionality (??????, why?), simpleXML and Reflection.

Now granted a beginner may not need some of those features, but they're going to be confused as hell when they try to use something like sessions and it's not there. I repeat, turning off session support? And hashes, which I'm assuming has to do with md5 and sha1 support... why turn these off? Reflection maybe, though once you become familiar with it, it's damn near indispensible. SimpleXML maybe... even PDO maybe... but SESSIONS? heh. Why?!
-m

Last edited by delayedinsanity : 08-10-2008 at 10:17 PM.
delayedinsanity is offline  
Reply With Quote
Old 08-10-2008, 10:32 PM   #3 (permalink)
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
Kalle is on a distinguished road
Default

Quote:
Originally Posted by delayedinsanity View Post
Your example of how you compile PHP is interesting, but you don't really go into any detail on why you compile it like that. That's pretty important so people don't try and compile it the same as you and then wonder why they're missing a lot of functionality - for example, and I may be incorrect about what this is doing, but you seem to be turning off a lot of VERY important/useful features, such as PDO, hash, session functionality (??????, why?), simpleXML and Reflection.

Now granted a beginner may not need some of those features, but they're going to be confused as hell when they try to use something like sessions and it's not there. I repeat, turning off session support? And hashes, which I'm assuming has to do with md5 and sha1 support... why turn these off? Reflection maybe, though once you become familiar with it, it's damn near indispensible. SimpleXML maybe... even PDO maybe... but SESSIONS? heh. Why?!
-m
"hash" means the hash extension (php-src/ext/hash). Functions like sha1(), md5() is apart of the core (documented on php.net).


And for the example, I would rather just do a "configure" that enables all default extensions and there from use additional arguments like "configure --with-mysql --with-mysqli"
__________________
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote
Old 08-10-2008, 11:08 PM   #4 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Quote:
"hash" means the hash extension (php-src/ext/hash). Functions like sha1(), md5() is apart of the core (documented on php.net).
I kind of thought that the md5/sha1 functions were core, but when I tried to find a man page on compilation directives, I turned up a whole lot of nothings.
-m
delayedinsanity is offline  
Reply With Quote
Old 08-10-2008, 11:20 PM   #5 (permalink)
The Wanderer
 
Join Date: Jan 2008
Posts: 21
Thanks: 0
Speeple is on a distinguished road
Default

delayedinsanity,

The configuration is specific to my environment, but I agree there needs to be some clarification. PDO, HASH, reflection, and session functionality is something I simply don't use. I maintain XML support via DOM, I just personally don't use the SimpleXML set of classes.

PDO - I use MySQL native driver (MySQL :: MySQL native driver for PHP - mysqlnd)
HASH - Beyond MD5/SHAx I don't require extra hashing capabilities - what % of users do?
SimpleXML - I use PHP primarily as a middle man for XSL transformations.

Thanks for the feedback tho, it's much appreciated.
__________________
AKA Martin Gallagher
Speeple is offline  
Reply With Quote
Old 08-10-2008, 11:33 PM   #6 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

That's what I was getting at in the end - your configuration is specific to your environment, and the tutorial should make a strong note of that, or provide an example that generalizes the optimization to a variety of environments.

I'm not sure how I read to others, but I wasn't trying to trash your set up so you know, just point out that it may not be suitable to others reading your tutorial. I can't live without sessions and reflection myself, but again I'm not saying that I'm the general public either.
-m
delayedinsanity is offline  
Reply With Quote
Old 08-11-2008, 01:32 PM   #7 (permalink)
The Wanderer
 
Join Date: Jan 2008
Posts: 21
Thanks: 0
Speeple is on a distinguished road
Default

Thanks buddy.

I've done some amendments taking note of the issues you brought up, e.g. more emphasis on the example configuration and notes to why.

Again, not really pleased with my writing style but there's no way around it :)
__________________
AKA Martin Gallagher
Speeple is offline  
Reply With Quote
Old 08-11-2008, 10:31 PM   #8 (permalink)
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
Kalle is on a distinguished road
Default

Seeing you do so many --disable-X and --without-X, then it would be easier to just say --disable-all and then --enable/--with those you need. Remember it requires you to define --enable-object-out-dir=DIR (atleast on Windows)
__________________
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote
Old 08-12-2008, 09:24 AM   #9 (permalink)
The Wanderer
 
Join Date: Jan 2008
Posts: 21
Thanks: 0
Speeple is on a distinguished road
Default

That would certainly simplify my configuration for re-use but it wouldn't allow me to write comments explaining why I disabled a certain feature.

I will add your suggestion in a revision of the post tho, cause it's certainly a very good tip!
__________________
AKA Martin Gallagher
Speeple is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 08:37 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design