PHP 5 Beta 1
Sterling Hughes writes "The PHP development community is proud to announce the release of PHP 5 Beta 1. Downloads are available in both source and binary form (for Windows users). A full list of changes is available in the ChangeLog. Some of the new features include much improved OO support, completely revamped XML support, and the default inclusion of SQLite."
--with-mysql=/path/to/mysql
bundled being the key word
vodka, straight up, thank you!
Check this thread on Google groups.
How small a thought it takes to fill a whole life
what's so difficult about using your own mysql installation? this refers to the bundled libraries. aside from changes mysql has made to 4.1, this is a non-issue.
maybe this will get them to included a bundled version of postgres
vodka, straight up, thank you!
If you're doing a non-trivial php site, and trying to make it work with different versions of php (osCommerce, for example), you end up having to rewrite many functions yourself to make sure they work consistently.
I like PHP, but it suffers from an "incrementalism" design approach. Some stuff really needs to be rethought, and I think PHP 5 is on the right track to doing that.
Do you even lift?
These aren't the 'roids you're looking for.
So how long until we get the final version?
...).
I'm currently developing a PHP project with lots of OO code and it's about as plesant as removing your eyes with a rusty spoon (some control structures implicitly copy objects, they don't know how to return references, you can't write $a->getB()->doSth();
Improved OO support in PHP5 would be really nice riht now.
if you have a huge site, doing that is a quite a tedious job. If you want a quick fix. Do the following for all of the variable arrays. -- foreach( $HTTP_GET_VARS as $key => $value ) { $$key = $value; } -- As I said, just do that for POST, COOKIE, SESSION etc. Also, you can change the order so that POST has more weight than get (POST variables overwrite GET variables.) by simply doing the POST after the GET :)
Do this in one file and include it in the top of every page. (If you have a config file, do it there, so you don't have to go and include it throughout your entire site)
This is an easy fix for doing what you want.
-goat
Not natively (yet) but there are several tools that do this for PHP, such as the Zend Optimizer or the popular PHP Accelerator (PHPA) http://www.php-accelerator.co.uk/
If there was some way that you could allow the user to have multiple PHP versions all being used as Apache modules where the user could select the one they want using their .htaccess file, that would be a possible solution.
Of course, the real solution is for the PHP development team to take the issue of backward-compatability more seriously then they clearly do at the moment.
On Sat, 28 Jun 2003, Marc Richards wrote:
l s&article=%3CPine.LNX.4.56.0306272256280.6461%40th inkpad.lerdorf.com%3E
> I apologies if this is the wrong place for asking. Is non-experimental
> Apache2 support planned for PHP 5?
Nope. Until someone sits down and goes through every 3rd-party library that can be linked into PHP on every platform and identifies whether or not they are threadsafe and under which conditions they remain threadsafe, using PHP in a threaded web server on UNIX is going to remain experimental.
You can of course stick with non-threaded prefork mode, in which case you basically have Apache-1.3.x. Nobody so far have been motivated to test Apache2-prefork+PHP extensively, so even that combination is going to remain experimental.
The basic problem here is that the average UNIX library has not been written with thread safety in mind. You can write very good specific threaded programs on UNIX, but it is extremely difficult to write something which can potentially link in hundreds of random libraries and expect them to all be threadsafe.
-Rasmus
http://news.php.net/article.php?group=php.interna
John Kerry is a Joke!
I don't mind so much the fact that you can't have servlet-like objects which handle entire sections of your URLspace (as opposed to one URL -- how very un-spider-friendly.
Nah, it's easy http://www.sitepoint.com/article/485 -- no question marks needed!
um..
O KIE);
extract($_POST);
extract($_GET);
extract($_CO
?
bananas like monkeys.
Advice: .dll (Depending on which webserver you're using - php4apache.dll for Apache, php4isapi.dll for IIS)
.dll's to run PHP as an integrated CLI SAPI? Performance! This method was officially documented as a stable feature in the December 2002 build of PHP.
The default method of configuring PHP is with the CGI SAPI module (i.e., php.exe); A much better choice (imo) is to configure the CLI SAPI module - all you have to do is build the CLI SAPI
(Also, many websites refer to the two config methods as CGI and SAPI; This is not really correct since CGI *is* a server API. What they really mean is CGI SAPI & CLI SAPI)
So, why go through the trouble to compile
Ok, so you're still asking WHO CARES??? Here's why you care: When you use the '.dll' method (CLI SAPI), much more of the processing work is passed onto the kernel resulting in fewer system calls. A LOT of people complain that PHP is slow & inefficient compared to other webservers, but oftentimes, these people haven't tried the CLI SAPI of PHP! Their point of reference is an ISAPI webserver (IIS) & they are comparing apples to oranges.
To find out what SAPI you're using, just execute php -v
Observation:
PHP adds new functions & deprecates other functions waaaay too often; No wonder people are leery of upgrading!
Something like that already exists...it's called popoon and part of the bitflux cms project.
> No Java, no JSP man. Simply use PHP for web development.
> Forget Java man and go to PHP!
>
> PHP is 4 times faster than Java technology 'JSP' (Java server
> pages).
Substantiate that statement. What benchmark, what workload, etc.
> This tallies because compiled "C" program is 4 times faster than
> Java.
PHP scripts are re-interpreted, at runtime, *for every page hit*.
They're not C.
> Moreover, PHP is getting the object oriented features of Java
> language.
Yeah, *finally*. Partially. This is the 1st go. Java was designed from
the start to be OO, it isn't hobbled on like with PHP.
> The real usefulness of Java is 'Java applets' which run on
> client browsers but on the server side you simply use PHP.
Substantiate.
> PHP is a very lightening fast object oriented scripting
> language. PHP is 100% written in "C" and there is no virtual
> machine as in Java. Nothing can beat "C" language ("C" is a
> language which never dies!!)
Jeez, moron. What do you think the JVM is written in?
> (Java is just another language. The PHP project needs millions
> of Java programmers who can add the Java's language features
> like inner classes, static, private, protected and others to
> PHP. PHP already has some of java' features).
> Java programmers will really "LOVE" PHP as PHP class is
> identical to Java's class keyword.
I use Java and PHP, and I *loathe* PHP. It's single redeeming feature
is that it's everywhere. For the rest, it's a language with crappy
library support, that actively emcourages mixing the presentation and
business layer.
> Read the benchmars of Java JSP and PHP. PHP tops in the speed!!
Substantiate.
Uh, none of those links work, however here is a *recent* comparison of JSP and PHP using several different containers for JSP and PHP. It seems that the server setup has a great deal to do with the speed of the application (duh).
It's interesting that people like to make comparisons to JSP and ASP all the time but don't remark on what platform they run on. Obviously JSP running on tomcat/apache through with mod_jk will be slower than with just plain Resin.
And open should note that a statement like ' Kiss and say goodbye to Java language!!' almost sounds like a troll, when you consider Java is used for a great deal more than web applications, indeed the servlet functionality that JSP relies on is a *very* small portion of the overall tools that Java supplies to developers.
But whatever, use the right tool for the job and try to remember it's technology, not religion. The more options the better IMO.....
1400x1250 in a 640x480 world...
http://www.interakt.ro/products/Krysalis/
You can also use PHP as a generator in Cocon.
Yes yes.. To sooth all the scalp scratching surrounding PHP and FREE (quality) cacheing and encoding look no futher than
.001 slower than zend (faster than PHP Accelerator) and it FREE! Did I mention it works with Zend Optimizer , Zend Encoder and it can also Encode (protect) PHP files?
MMcache - http://www.turcksoft.com/en/e_mmc.htm
It's only a split second
I'm too damn good to you people! ; )
PS: PHP makes programming fun again. Thats why people like to use it. Simple really.
Both PHP and ASP are compiled and linked directly to the webserver daemon. CGI uses an interface and the engine is not loaded directly with the web server. This makes it alot slower and you lose all the benefits of what php has to offer.
http://saveie6.com/
I don't mind so much the fact that you can't have servlet-like objects which handle entire sections of your URLspace /var/www/servlet.php
You can! Use a PHP file instead of a directory for your DocumentRoot in apache.
I.e DocumentRoot
Now all requests are handled by servlet.php.
A more flexable approach I use for the same effect is a
This means if you request
You can find it on sourceforge.
Its basically apache2, perl 5.6, tlc/tk, python 2.2, mysql, and php 4.2 installed as one package. I think their is a Unix version as well but I do not use it.
http://saveie6.com/
PHP 5 isn't really documented in the PHP 5 manual yet as there are still a few features on the move, and new features to come, but here's a list of PHP 5 related articles and presentations:
Faq: Where can I get more information about PHP5?
Enjoy!
Nah, I reckon one could handle it like this...
/home/myhost/engine.php /res /home/myhost/resources ... or something. I tried it on my server and it seems to work a treat. Once again cheers for the tip
<VirtualHost *>
ServerName www.myhost.com
DocumentRoot
Alias
</VirtualHost>
I am pretty sure that PHP 4 comes with a MySQL client library, and it is enabled by default during 'configure'.
In FreeBSD Ports, it compiled the MySQL client package and uses it instead.
Some people are bound to bring up the $109 Microsoft Visual C++ Learning Edition,
Actually, you can download the non-optimizing compiler for free from their web site. Seriously though, who wants a compiler with no optimization?
Yeah, and I got PHP5b1 up and running in about 10 minutes. No time spent compiling. ;)
Nothing works! At least, nothing using PHP4's OO features. And I used a lot of PHP4's OO features!
I'm going to spend the rest of the day tearing out my hair. Especially because I'll have to rewrite 1000+ lines of PHP code....
Both will win.
The latest news from Sun is that J2EE 1.5 will support scripting languages. And the reference implementation will be done in PHP.
If you don't believe, check some of the news site reporting on JavaOne 2003.
MySQL isn't bundled with it, but you can easily add it yourself when compiling.
Compiling?
Compiling PHP for Windows requires the Microsoft Visual C++ compiler version 6.0 or later.
Exactly version 6.0, not "later" (because you can't compile/link with GPL stuff with the 7.0/.NET compiler due to licensing restrictions).
even better: (add to .htaccess file to your codebase directory)
php_flag register_globals On
Actually if you go read that OOP page properly you will see that they added a lot of features needed to be a proper OO language. In every case they said "If you don't use this feature, the old method will be used". As far as I can tell this keeps compatability.
As for the new arrays that appeared in newer versions of PHP that broke everyone's scripts. It's a simple configuration change that will revert PHP back to the old methods while you change your scripts to get them working again.
Those new arrays ARE necessary. The old method of getting your form data is badly insecure. They explained all this, and gave example code as to why the old ways were bad. I believe it went something like this:
if (isAuthenticated()) {
$authenticated = true;
}
In that example $authenticated would Never be set using a form. But, if register_globals is set to on, all a person would have to do is pass a 'authenticated' parrameter to the script and they have instant access. Yes it's a pretty stupid thing for a programmer to do, but these things do happen. I think everyone should be FORCED to upgrade to the new version.
PHP is Still simple. You can still write the basic code you want to write, but it now gives us the functionality we want to make really powerful scripts. At least I know I want them. I will use 90% of those new features as well. As far as I'm concerned these changes are LONG overdue and it's about time PHP caught up with the real world.
In case anyone is interested, I've followed the PHP5/MySQL on my blog. (it also contains instructions for getting MySQL back into PHP)
It's not bad. In the case of PHP it's not needed. PHP is not a storngly typed language so you can write a getBalance() function which can take any damned thing you can pass in.
Once inside the function you can test the passed in variable and take appropriate action.
You can also do other crazy things like declare functions without parameters and pass parameters into them.
You can declare methods that act as "default" method handlers.
You can add methods to objects at runtime!.
Hell you can even define classes at runtime.
It's highly dynamic.
If
War is necrophilia.
Instead of ODBC, you'd be better off using the pear/db module as middleware. It supports more databases (mysql, odbc, sqlite, pgsql, etc.) and if it isn't the future standard for database access in PHP, something like it will be.
I've been using PHP's built-in (until now) MySQL functions, because they're faster than pear/db, but this licensing dust-up has convinced me that portability among database vendors is worth a performance hit. And the pear/db module is getting increasing attention and is likely to get faster.
My biggest complaint about PHP is the joke that they pass as "error handling". Yeah great, thanks for exposing all my path names to the outside world if something goes wrong.
Psychic abilities will be added to PHP as of version 6.6.6. From here on you will be able to simply think of the configuration you want and it will be set in php.ini. No longer will you have to read the extremely comprehensive online docs including the manual and especially not the ENTIRE SECTION dedicated to error reporting and logging that tells you extremely clearly how to do what you have just complained is impossible. You would not need to read that page and find the two links within the 1st side that show very clearly information on the display errors, error_log for custom logs and of course log errors to put the errors in the apache logfile.
Your biggest complaint is that you are too lazy to read the manual and you expect everything to be done for you. No programming language can help you with this.