Domain: php.net
Stories and comments across the archive that link to php.net.
Comments · 1,658
-
Re:caching and diffs (Re:Having read the article..
-
PHP >= 4.3.0 is not a great update
Class methods are not working as they should in PHP >= 4.3.0; I'd suggest to anyone who does OO in PHP to stay with 4.2.3 as long as they want to keep their scripts working. See for yourself this Bug report
-
Re:Its funny...On the other hand, if you are looking for a needle in a haystack
You might want to try PHP:
Description
string strstr ( string haystack, string needle)http://www.php.net/manual/en/function.strstr.php
"I always suspected that Google was one line of code..."
-
Re:Doubtful!
I'm not quite ready to say that PHP will rule over Java, but it's not what you make it out to be. Common myths that you brought up:
1) PHP dev ties you to HTTP. While PHP was originally developed for WWW, and is still commonly installed as a web server module, it also has fully functional CGI and Command-Line modes, either of which execute nicely at the command line.
2) You can't use PHP to run/compile a console/client application Again, this is not true. You can compile PHP code (with the Zend encoder) and you can write decent, client-side applications with PHP-GTK.
Again, I'm not saying that PHP==Java, but I do want to see a powerful tool get the respect it properly deserves! -
A way to secure php
cd
/usr/ports/www/mod_php4
make -DWITH_APACHE2 ; make install
Then go to php.net and read the manual.
php security
Thats all falks! -
A way to secure php
cd
/usr/ports/www/mod_php4
make -DWITH_APACHE2 ; make install
Then go to php.net and read the manual.
php security
Thats all falks! -
Re:PHP is the destination
PHP is "the one" for me!
Now with the gtk extensions it does a mighty fine job on the server or on the client!
It has the ease of text manipulation of Perl without all the nasty hacks in syntax. It's cross platform, free, and performance is good. (Probably better than Java, since my own testing indicates it's considerably faster than Python)
It makes a good, all-around scripting language for sysadmining, UI management, etc. and it even makes a good case for fast web development!
Among other things, a web server (yes, a replacement for Apache!) has been written in PHP!
I figure that with all the noise of "web services" this, and "cross platform" that, there's a good chance that PHP could be the "next big thing"...
Yeah, I use PHP an awful lot. -
Re:PHP is the destination
PHP is "the one" for me!
Now with the gtk extensions it does a mighty fine job on the server or on the client!
It has the ease of text manipulation of Perl without all the nasty hacks in syntax. It's cross platform, free, and performance is good. (Probably better than Java, since my own testing indicates it's considerably faster than Python)
It makes a good, all-around scripting language for sysadmining, UI management, etc. and it even makes a good case for fast web development!
Among other things, a web server (yes, a replacement for Apache!) has been written in PHP!
I figure that with all the noise of "web services" this, and "cross platform" that, there's a good chance that PHP could be the "next big thing"...
Yeah, I use PHP an awful lot. -
Re:PHP is the destination
PHP is "the one" for me!
Now with the gtk extensions it does a mighty fine job on the server or on the client!
It has the ease of text manipulation of Perl without all the nasty hacks in syntax. It's cross platform, free, and performance is good. (Probably better than Java, since my own testing indicates it's considerably faster than Python)
It makes a good, all-around scripting language for sysadmining, UI management, etc. and it even makes a good case for fast web development!
Among other things, a web server (yes, a replacement for Apache!) has been written in PHP!
I figure that with all the noise of "web services" this, and "cross platform" that, there's a good chance that PHP could be the "next big thing"...
Yeah, I use PHP an awful lot. -
Re:PHP is the destination
PHP is "the one" for me!
Now with the gtk extensions it does a mighty fine job on the server or on the client!
It has the ease of text manipulation of Perl without all the nasty hacks in syntax. It's cross platform, free, and performance is good. (Probably better than Java, since my own testing indicates it's considerably faster than Python)
It makes a good, all-around scripting language for sysadmining, UI management, etc. and it even makes a good case for fast web development!
Among other things, a web server (yes, a replacement for Apache!) has been written in PHP!
I figure that with all the noise of "web services" this, and "cross platform" that, there's a good chance that PHP could be the "next big thing"...
Yeah, I use PHP an awful lot. -
Re:Kiss and say goodbye to Java language!!
Java is a general purpose programming language, PHP is not. PHP is a scripting language designed for server side web scripting. Ever tried writting a server in PHP? You can't, it doesn't let you accept incomming socket connections.
Ahem
...
socket_accept()
socket_bind()
socket_listen()Taken from User Contributed Notes on php.net (author diogo at michelangelo dot edu dot br )
// first we must to create a socket which will be used to listen
// a connection (0 mean protocol type - TCP)
$mysock = socket_create(AF_INET, SOCK_STREAM, 0);
// now bind call a port (20000) with a socket on 127.0.0.1 address
socket_bind($mysock, "127.0.0.1", 20000);
// accepting conenctions on a socket and port
socket_accept($mysock);
// using socket_listen we can specify how much connections we will to accept
socket_listen($socket, 10); -
Re:Kiss and say goodbye to Java language!!
Java is a general purpose programming language, PHP is not. PHP is a scripting language designed for server side web scripting. Ever tried writting a server in PHP? You can't, it doesn't let you accept incomming socket connections.
Ahem
...
socket_accept()
socket_bind()
socket_listen()Taken from User Contributed Notes on php.net (author diogo at michelangelo dot edu dot br )
// first we must to create a socket which will be used to listen
// a connection (0 mean protocol type - TCP)
$mysock = socket_create(AF_INET, SOCK_STREAM, 0);
// now bind call a port (20000) with a socket on 127.0.0.1 address
socket_bind($mysock, "127.0.0.1", 20000);
// accepting conenctions on a socket and port
socket_accept($mysock);
// using socket_listen we can specify how much connections we will to accept
socket_listen($socket, 10); -
Re:Kiss and say goodbye to Java language!!
Java is a general purpose programming language, PHP is not. PHP is a scripting language designed for server side web scripting. Ever tried writting a server in PHP? You can't, it doesn't let you accept incomming socket connections.
Ahem
...
socket_accept()
socket_bind()
socket_listen()Taken from User Contributed Notes on php.net (author diogo at michelangelo dot edu dot br )
// first we must to create a socket which will be used to listen
// a connection (0 mean protocol type - TCP)
$mysock = socket_create(AF_INET, SOCK_STREAM, 0);
// now bind call a port (20000) with a socket on 127.0.0.1 address
socket_bind($mysock, "127.0.0.1", 20000);
// accepting conenctions on a socket and port
socket_accept($mysock);
// using socket_listen we can specify how much connections we will to accept
socket_listen($socket, 10); -
Even easier: PHP shell_exec()
shell_exec() will do what you want in one line of PHP.
-
Re:Why PHP rather than Perl?
Actually there is a system of separating content from code, in PHP. This is called Smarty and it's pretty good, it even automatically compiles templates into native PHP code each time the templates are updated (checking is done via the file's last modification time). Smarty has been around for quite a while and appears to be pretty popular.
-
Re:Phpp
Your comment isn't entirely fair.
Sure, you can do all that in Perl, but only because someone has bothered to write the appropriate CPAN modules for you. That's not the same as saying you can't do those things in PHP.
As PEAR and PECL (PHP's answer to CPAN) comes into it's own, I suspect you will see a lot of that functionality get ported over to PHP. Heck, some of what you mention has already been done.
But to say that PHP is not capable of doing any of those tasks is disingenuous. -
Re:Why PHP rather than Perl?
Using Mason or Ax Kit or (insert templating system here) in perl will get you that much beloved separation of code and presentation that PHP tries so hard to discourage.
http://smarty.php.net/
PHP's trying to discourage templating? -
Re:online user comments on
Beyond the comments, the "404" page pretty slick! It appears to try to find what you were looking for in the manual pages before telling you you made a mistake.
For example, you can go to http://www.php.net/date and it will take you to the date() function in the manual, even though http://www.php.net/date does not exist. This works for all of the functions, as far as I can tell. -
Re:online user comments on
Beyond the comments, the "404" page pretty slick! It appears to try to find what you were looking for in the manual pages before telling you you made a mistake.
For example, you can go to http://www.php.net/date and it will take you to the date() function in the manual, even though http://www.php.net/date does not exist. This works for all of the functions, as far as I can tell. -
About php.net
I have never had any problems with php, because of the excellent, (almost?) clearly written documentation.
However what have suprised me on local php developer forums is that people completely new to any kind of programming find the site very technical and difficult to understand. Therefore will they often seek for alternative resources, like books or websites.
As you mentioned the free php projects, I have to say that I don't think that you can get very much out of those. I find it much better to look at small snippets than large projects, because it's much easier to understand. Especially for beginners.
-
PHP online manual has poor comments?
1. I've always found that the comments are helpful marginalia which can point out obscure cases where PHP might fall over, an alternative function which will work better than the one you're looking up, etc.
and...
2. If the user notes bother you, you can download the entire manual in HTML as a BZ2 archive (it's about 830KB) from the PHP website. -
Re:Great!
I've not heard of PHP being slow before. I've been using it for 3.5 years and I've been very impressed by it's speed.
Gee, let's bitch about a free, lighting fast database that gives 95% of users what the need, but charges for a small, specialized add-on.
As for a debugger - how many PHP developers have a need for a debugger? There are some, you say? I agree, and for those folks they're hopefully using a decent templating engine like Smarty which includes a very slick debugging window. -
details details details...I used this book as a secondary reference for a Database course a couple of years ago, and then later for a reference on developing an online MessageBoard using PHP.
The book is pretty good, but tends to gloss over some of the more technical issues of PHP. In addition, the book tries to cover so much that there are a few parts that are missing some of the more complex details. For example, the section on PHP Session Management was a little too brief for my liking, and ended up being supplemented with material from http://www.php.net
These were are fairly minor issues and the only really *serious* issue I had with the book was the section on MySQL installation. It made the installation look so simple and straightforward, when in fact it was not. I attempted installing MySQL on several different boxes under both Mandrake and Redhat. In the end, the MySQL server was installed on a secondary machine under FreeBSD, where it installed without a hitch.
-
Re:online user comments on
I will agree to an extent...
When I am writing a web-app... I will often go to their sites as a reference... however, I find that the examples are sometimes lacking.
MySQL's site is rather poorly laid out and makes assumptions that you already know all there is to know about MySQL - pretty good reference, poor for learning from.
PHP's website is excellent - again though - not a great learning source... there are user submitted examples - but they aren't moderated or proofread... so are often garbage.
I think I've learned more about PHP/MySQL from books and PHPBuilder than I have from the actual PHP/MySQL sites... -
Ok, I'll bite.
PHP doesn't even have fucking destructors for classes! What a joke! From the PHP manual:
Note: There are no destructors in PHP 3 or PHP 4. You may use register_shutdown_function() instead to simulate most effects of destructors.
That's pathetic.
-
Re:AOL
Not really. AOL isn't doing it for any Evil Intent.
Usually, the most important data is the first page hit. WHICH PAGE/SITE REFERRED THE PERSON TO THIS WEB SITE? In most cases, where the person is connecting from is not nearly important as where they found the link.
An ecommerce example: When showing site statistics, I advise my ecommerce clients to put their money in the referring sites that yield the highest 'bought a product' ratio.*
Once in a while, the client will be awed by the AOL total hits statistics and want to put money there. I then explain that they will most likely increase their bandwidth use with little return and have to pay AOL for the privilege.
A site that depends on banner ads example:
Put money in referrer sites where the referred person viewed the most pages AND clicked the most ads per person. Accurate statistics for that are easy with PHP scripting (or your language of choice). Bonus points for using a script that counts returning visitors and compares that to where they were originally referred from.
* It has crossed my mind that I could be mean/funny and generate 'how many attempts it takes an AOL user to fill out a form correctly' statistics. -
coding standard
...(PEAR) is an online repository of high-quality, peer-reviewed PHP classes that conform to a rigorous coding standard.
how come that since years, everybody talks about coding standard and I can't find the word 'documentation' in these standards?
Just a couple of hours ago I tried out the Spreadsheet_Excel_Writer (a port of perl's Spreadsheet::WriteExcel Perl). It does not contain ANY documentation. Yes, some lines are commented and most parameters are described. But you won't find a word telling you how to use it.
It's formatted nice, there are no unchecked parameters, yes, yes. but no docs. bah. -
Re:Outsider PerspectiveYes. It Runs per se. But if you go into php bug database and apache2 related bugs and look into #17868 you will know the reason.
Atleast, this is the case for me not to migrate our production environment since machines im managing are based on ssi based templates and i there is shitload of rewriting unless this wont get fixed.
-
Re:Outsider PerspectiveYes. It Runs per se. But if you go into php bug database and apache2 related bugs and look into #17868 you will know the reason.
Atleast, this is the case for me not to migrate our production environment since machines im managing are based on ssi based templates and i there is shitload of rewriting unless this wont get fixed.
-
Re:Outsider Perspective
What's important to note here is that far from all extensions which are being developed for Apache are in a production stable state on the 2.x platform. One every good example is PHP, which just recently with the 4.3-version was announced to be stable on the Unix-version. Windows webservers serving PHP should still use the 1.3.x-branch a little while.
As the download-page on php.net announces: "PHP 4.3.0 zip package [5,811Kb] - 27 December 2002 (CGI binary plus server API versions for Apache, Apache2 (experimental)" -
Re:Outsider Perspective
What's important to note here is that far from all extensions which are being developed for Apache are in a production stable state on the 2.x platform. One every good example is PHP, which just recently with the 4.3-version was announced to be stable on the Unix-version. Windows webservers serving PHP should still use the 1.3.x-branch a little while.
As the download-page on php.net announces: "PHP 4.3.0 zip package [5,811Kb] - 27 December 2002 (CGI binary plus server API versions for Apache, Apache2 (experimental)" -
Re:Outsider Perspective
What's important to note here is that far from all extensions which are being developed for Apache are in a production stable state on the 2.x platform. One every good example is PHP, which just recently with the 4.3-version was announced to be stable on the Unix-version. Windows webservers serving PHP should still use the 1.3.x-branch a little while.
As the download-page on php.net announces: "PHP 4.3.0 zip package [5,811Kb] - 27 December 2002 (CGI binary plus server API versions for Apache, Apache2 (experimental)" -
Re:Office productivity and visual basic.
-
Re:Summary
Register Globals: since I don't have control over the physical server, I cannot turn this option off.
I found in the PHP documentation that you can turn PHP INI options on and off at runtime. For example, you can turn off register globals like so:
ini_set ('register_globals', '0');
-
Re:PHP Wishlist
With the upcoming major release (PHP 5) PHP will overcome its deficits when it comes to object-oriented language constructs. Have a look at this for a list of new features of the Zend Engine 2, the compiling and executing kernel of PHP 5. The Script Running Machine (SRM) completes PHP to an Application Server by providing a co-process to the web-server that runs persistent PHP objects.
-
Re:They really need a session on security.
Try is_int() or is_numeric(). The latter will return true for strings that are all number as well (ie. '123').
You can also convert that string to a number via:
$num = (int) $num;
Validation/filtration is pretty easy in PHP. I agree though, the tutorials usually don't provide enough references as to what functions are useful. Regexes can only take you so far (quite far albeit) before your application shows a noticeable drop in performance.
It would be nice to see PHP Security added to the list of topics.
-
Re:They really need a session on security.
Try is_int() or is_numeric(). The latter will return true for strings that are all number as well (ie. '123').
You can also convert that string to a number via:
$num = (int) $num;
Validation/filtration is pretty easy in PHP. I agree though, the tutorials usually don't provide enough references as to what functions are useful. Regexes can only take you so far (quite far albeit) before your application shows a noticeable drop in performance.
It would be nice to see PHP Security added to the list of topics.
-
Re:Where is my...Try PHP CLI.
It's been able to work like this for a long time (using the cgi version, "#!/usr/bin/php -q"), but as of 4.3.0 they're officially supporting command-line mode as an option.
-
Re:Where is my...
-
PHP 2003 year-in-reviewPHP 2003 year-in-review (or go to http://php.net/ and click on "PHP Look Back 2002."
BTW, PHP news is available in RDF format as a Slashbox. Go to your Slashdot "preferences" to add.
As for Language wars, no language is better, it's just a better tool for a particular job.
-
Re:Where is my...
you are so right... I missed this point...
But as far I can see, they are trying hard to make it usable as scripting language. -
Re:Where is my...
you are so right... I missed this point...
But as far I can see, they are trying hard to make it usable as scripting language. -
Where is my...
-
Where is my...
-
Re:Ok, let's think this through....but as a general question, is it worthwhile to look into "compressed" web pages, e.g., foo.html.zlib? (I tend to doubt the savings are that much for the "average" page, but shoving graphics into an archive might keep down the number of requests needed to fetch a whole page and its graphics.)
Yes, it can be worthwhile. Text compresses very easily, and considering that most graphics on the web are precompressed (jpeg/png/...) the savings are often mostly in the text compression.
Have a look into Apache mod_gzip for more information - most browsers understand gzipped pages natively, although some proxies are broken. Also see the section in the PEAR manual at PEAR about HTTP classes - there's HTTP compression in there too.
-
In case of Slashdotting
Warning: mysql_connect() [function.mysql-connect]: Too many connections in
/home/virtual/site23/fst/var/www/html/pnadodb/driv ers/adodb-mysql.inc.php on line 170 mysql://dietcoke:@localhost/techfocus_org failed to connectToo many connections -
Misconfigured webserver!
Warning: mysql_connect() [function.mysql-connect]: Too many connections in /home/virtual/site23/fst/var/www/html/pnadodb/driv ers/adodb-mysql.inc.php on line 170
mysql://dietcoke:@localhost/techfocus_org failed to connectToo many connections -
Or
-
custom programming and freelance in php and mysql
-
Re:PHP???