Domain: php.net
Stories and comments across the archive that link to php.net.
Comments · 1,658
-
phpclasses.org
People keep mentioning php.net. I have to put my vote in for phpclasses.org. No friendly tutorials here, just the code you need. Functionality ranges from basic stuff like turning recordsets into an HTML table, to more advanced things like data caching.
-
Only reference you need for PHP
Is right here.
-
Umm... why not just read the docs?
I learned all I ever needed to know about PHP from the PHP Manual. MySQL also includes a somewhat monolithic html file that provides a quick reference, as long as you know SQL.
A useful little tidbit: If you want a quick way to look up information in the PHP Manual, go to http://www.php.net/whatever-you-re-looking-for. For example, http://www.php.net/mysql will take you straight to the reference pages for MySQL. -
Umm... why not just read the docs?
I learned all I ever needed to know about PHP from the PHP Manual. MySQL also includes a somewhat monolithic html file that provides a quick reference, as long as you know SQL.
A useful little tidbit: If you want a quick way to look up information in the PHP Manual, go to http://www.php.net/whatever-you-re-looking-for. For example, http://www.php.net/mysql will take you straight to the reference pages for MySQL. -
I've said it before
And I'll say it again. The best way to learn php is through the php website. Go through all the documentation. You will learn more about what actually works and what doesn't than what a book can tell you. A book is always about a version behind PHP, and so learn it through the website.
That's how I learned php 3 years ago, and well, I'm better with php than most. -
As an alternative to Perl......I don't mean to criticize Perl, since it's my favourite language for medium to complex applications for years. You just can't beat the power of regexps
:)Yet, I've found myself writing more and more smaller apps using PHP instead of perl. It's by the Apache group and essentially merges into the www server, making it very quick. You can still use mod_perl for perl apps.
Along with your preferred SQL database, progranmming in PHP is a breeze. Basically, write html pages and add the commands you need embedded inside. The best PHP book I have on that topic is PHP and MySQL Web Development (ISBN: 0672317842) second to none.
-
Misuse of termsThere is a lot of misuse of terms on SlashDot I think; "Open Source vs Microsoft" == "GNU/Linux vs Microsoft", "OSS" == "GPL Software", etc.
These things are very different; there's a tonne of open source software out there that lots of people use that isn't GPL:
- Perl - Artistic License and GPL
- PHP - PHP License
- Apache - Apache Software License
- Free/Open/NetBSD - BSD License, and some bits of Beerware
- Mozilla - Mozilla Public License
- Python - Python Software Foundation License
- Zope - Zope Public License
- zlib/libpng - The zlib/libpng License
To constantly suggest that the GPL is the One True License is not only wrong, but very damaging, since it undermines perceived choice over licensing.
This is supposed to be a site for vaguely intelligent people; can't we at least make some effort to be more precise in our terminology? - Perl - Artistic License and GPL
-
Re:Bringing it all together
Should I take "Alpha" to be the warning that it sounds like it is, or would it be safe to try it out now?
To quote from www.php.net:
This is an alpha version. It should not be used in production or even semi-production web sites.
I would take their word for it
:) -
PHP has finally made it...
Long ago, I used php on a very small project, and it worked wonderfully (due to the utter simplicity of the project).
Since then, I have not touched it, due to immature error handling, terrible objects and inconsistancies between functions and methods.
It seems that this version (based on the Code Samples) has fixed most everything I once hated, and that I might get to use php in a production enviroment sometime soon.
Most important things to me are try/catch and destructors.
-
Re: execution times
Or use this function at the top of your script:
void set_time_limit ( int seconds)
as described on php.net -
Re:Irony
The EFF, a foundation created to defend the technological freedoms and rights of individuals around the world, is promoting the use of Macromedia Flash, the success of which will fill the coffers of a pro-DMCA company at the expense of open W3C [w3.org] standards. The irony is sweet and poignant.
Please point me to the place on the W3C site where it talks about an open standard for what flash does. Are you going to try to refer me to SVG? I don't think that will fit the bill. Don't see anything about sound or interactivity.
Perhaps you could stop your whining and generate your Flash from PHP, or you could head over here and read the spec for Flash, published by Macromedia in 1998. -
The way I see it, It's like choosing a woman.
One is sort of chunky and ugly, and she won't let you see her naked, and you pretty much know already that you wouldn't really enjoy it if she did. The other has a slim, beautiful body, and when she takes off her clothes and parades it around, all the men ooh and ahh over it. That's the analogy I like to use. Maybe it isn't 100% correct, but that's the impression I get when you've got MS saying "No, no, you don't want to see our source code!" and meanwhile, you've got these open source softwares that are taking it all off, and saying "hey, baby, look at THESE!" Microsoft is NOT sexy. Linux, apache, and all of those wonderful open source projects ARE. But this is just how I see it. I mean, if I was to go on a date with a woman, and she proudly told me that she has an MCSA certification, I'd probably politely nod, but secretly be planning on my escape (maybe run away after telling her I had to use the restroom). On the other hand, if she told me that she had her own php based website, and that her text editor of choice was vim, then I'd be all weak-kneed and googly-eyed, and I'd want her to have my children. But again, that's just me. I don't know how it is for other people. I mean, I may not really UNDERSTAND beautiful women, but I sure like to look at them. So, I don't think there's any action required, as in "let's get rid of Microsoft." I think that it's really just a matter of educating the masses that there's an alternative, and it looks good naked. Or as you might say, it's a lot safer because the code can be (and is) made public without compromising national security.
-
Re:php support
A lot of work has gone in to the PHP apache2filter recently, and in the soon-to-be-released 4.2.1 it is looking much better. Please give that version a try and report any bugs you find.
-
php support
There are many sites using PHP scripting, but Apache 2.0 support in PHP 4.2.0 is experimental, I wonder how many months before we see webservers migrating to Apache 2.
-
Re:Linking to the site and the story
Why does problem.com lead to php.net?
-
Re:What Java really needs...Well, I like java, but it's still special purpose to me. It excels in ecommerce and dynamic web stuff. It may someday excel at distributed systems since it will be easy to move code around various devices on a network.
I dunno. I can do the same without having to recompile every time I make a change.
And it's open source
:) -
Re:limitations for Mac OS X users... sigh
yes, PHP support is still lacking a bit from our beloved OS X...
here are some links on the subject that may be of some interest:
http://developer.apple.com/internet/macosx/php.htm l - Apple's PHP page where they "admit" that...
Like all Unix variants, Mac OS X has it quirks. It is also a young OS, and not all Open Source or Unix software projects have had time to test their programs on the Mac and make the necessary alterations
Linked from that last page is http://www.entropy.ch/software/macosx/php/ - a site concerning a prebuilt PHP Apache module for OS X... they are working on the 4.2.0 version and I don't have a doubt that these folks will deliver...!
Installing pre-compiled MySQL, PHP and Graphviz packages on a OS X-running powerbook was a great (and quick!...) experience. May everybody taste the sweet pleasure of writing PHP code on their balcony! :-)
Greg -
Re:Valid XML fragment
Just add "
... ?>" before your fragment and feed it to xml_parse. See http://php.net/xml.
- Stig -
Re:PHP functions
Semi off-topic, but you just can't compare CPAN to PEAR
CPAN and PEAR have nothing in common. CPAN stands for Comprehensice Perl Archive Network. This highly active site is maintained by the Perl community. From CPAN you can find hunderds (thousands?) of Free Perl libraries and corresponding on-line documentation.
PEAR web page says "PEAR is a framework and distribution system for reusable PHP components". So among other things, it acts as an abstraction layer to various RDBM's.
I don't think there's full equivalent to PEAR in Perl world but what the original poster probably meant is DBI - The Perl Database Interface. -
Re:new functions / features in 4.2.0
err
... try this instead -
Re:new functions / features in 4.2.0
right here man
-
Re:PHP functions
Yeah, it's a bit ugly having a flat namespace of, let's see;
-<freaky@voi:~/src/phpdoc/en/functions>-
-% grep '<refentry id="function\.' *.xml |wc -l
2579
2579 functions.
Although I can see the argument for having all the compiled-in extensions loaded all the time, having absolutely everything in the same namespace makes writing procedural code a little dangerous, not to mention leaving a nasty taste in your mouth if you're trying to code in an OO fasion.
The answer is, of course, to put your functions in a seperate namespace (a class in Zend 1, a proper namespace in Zend 2), or to use a naming scheme that's less likely to conflict (personally I use WordCaps (or camelCase) instead of under_scores, but since PHP doesn't stick to under_score style all the time and isn't case sensitive, this isn't a wonderful solution).
Coding in an OO fasion's less an issue for namespace conflicts, and more an issue for getting procedural code thrown in everywhere unless you load performance draining wrappers. PHP's weak object model doesn't help here. After using Ruby I find myself running into PHP's limits a lot harder. *grumble*
I hope that they will move extensions to make use of namespaces sometime (PHP 5, or 6 maybe); i.e. MySQL::connect(), PgSQL::connect(), etc. If nothing else this will help make the language cleaner.
BTW, as for CPAN, some of the PHP bods are trying to produce something like it; PEAR, which includes a passable database abstraction layer, among other things.
Personally, I'd be using Ruby if it had better webserver embeddability (mod_ruby doesn't yet support Apache 2, and the Apache 1 support feels a bit immature) and a nicer CGI API. Running it as a daemon might be an interesting solution, but finding hosts who will allow that might be a bit of a pain. Maybe I should try it out while I can :) -
Re:PHP functions
Have you taken a look at PHP 4.x's equiv to the CPAN yet, PEAR?
Using PEAR I have items such as database abstraction, PHPDoc (JavaDoc for PHP basically), and much more.
Sure it is a layer on top of what is available but if you combine this, with APC or Zend you can precompile everything to byte code for faster execution.
Documentation for php is also very easy to find. You have it available for download in HTML, TXT, Windows CHM, and PalmDOC formats. All of this is also available online fully searchable with comments from the users.
As for your complaint about the built in nature of all the database access functions, how else would you do it? Generate .so/.dll libraries for the functions so you can update them later? (This is already done.)
Now on to your complaint of long function names. How else should we do it? Use something cryptic like hungarian notation so we end up with a function that looks like "pidbcm" for returns a pointer to an in and i am a database connect function for MySQL? Personally I don't find a problem with identifiers up to 50 characters long so long as they define what the identifier is. The compiler will take them out anyways. -
PHP Interface to GoogleAPI
-
CONGRATS!
Yeeeaah! Do you think this is big enough to win back some numbers for Apache? I noticed that when PHP 4 came out, it got a pretty big jump in numbers (early-mid 2000). Apache 2 seems like A Big Deal that might punch up the Apache stats.
-
Re:The main problem as we see it.:-)
Eudora is safe... but assuming that you're safe only because you're using eudora is foolish.
Saying that Eudora has a bug because they choose to offer IE rendered email is false
I have all HTML rendering turned off... This reduces the amount of spam I get down to maybe 1 or 2 "unsolicited" a day... in many emails, the sender sends it in HTML, with a small graphic in the html that could look something like this:
<img src="http://some.spam.jerks.com/YOUR-EMAIL@YOUR.H
O ST/invisible.gif">
often times they don't format the rest of the email
for those of you that don't know, PHP can take directory names as paramaters into a script, just check out php.net this link points to "print", but php will take you to the print manual page -
Re:Open Source Software As Well
Regarding "Proprietary X" not being able to make the deadline, the scenario I outlined was in regards to "Proprietary Y" *INTERFERING* with the ability of "Opensource X" to purposefully push them past the deadline with the intention of purchasing the source code as the highest bidder. It is unlikely that "Opensource Y" would be able to sufficiently interfere with the deadlines of "Proprietary X".
The difference between Opensource and Proprietary software can be explained such as this: "Open source software makes the 'recipe' available to those who wish to bake their own, allowing them to modify the recipe. Proprietary programs only sell the pre-packaged baked goods." I explained it to my Grandmother who is still calling her mouse a rat. I think judges are intelligent enough to understand the concepts of "This makes this available for x amount of money while this makes this available PLUS the recipe for free."
Regarding the bug in PHP- you say it was just discovered 2 weeks ago? According to PHP as of Feb. 27th there is a fix. Either you're off about the date of the bug being 'discovered' or the response time is a phenomenon where the bug is fixed prior to being discovered. ;) Either that or another bug has been discovered along the same lines and has not been announced. Remember, we're not discussing undiscovered bugs that exist in the software and asking that developers be able to predict everything. We're talking the discovery time:time to patch ratio. In the Opensource community it is habitually lower with patches coming out every time a bug is discovered and a patch made available. If you're wrong about the date that the bug was discovered and the bug has actually been common knowledge since PHP3 then yes, the OSS community is in error, however it is a VOLUNTEER effort and should not be required to follow any standards higher than notifying the public of the bug's existence so that they can take the necessary measures to disable problematic parts of the program or temporarily replace it with an alternative. Proprietary code often has no viable alternative--Are people able to pay a few hundred dollars to switch from an application they've already paid a few hundred dollars for to another one? The ability to switch mid-race to another opensource program is unimpeded by monetary concerns.
Finally- on the concept of "All or nothing", law is never "All or nothing". There are many shades of gray and different groups are treated differently. For example, Apple is allowed to get away with business practices that MS would find themselves back in court for. Apple has a smaller marketshare and thus is not considered to be violating antitrust laws even when they are using unfair business tactics. I do not think it's unfair for the law to recognize that the Opensource community has limited funding and cannot hire the extra manpower that it might take to make the patches, while 'Proprietary Company X' has charged for their software and has essentially promised them a service that it should be bound to deliver.
-Sara -
Re:From Tanenbaum...
Yeah, whatever but right now network bandwidth is fscking expensive. OTOH I'm not sure that an appreciable quantity of the bandwidth from a website is actually text.
FWIW these guys use php's ob_gzhander function and appear to get quite good results.
Dave
-
Re:so wait a minute...
Those are the breaks with proprietary, closed-source crap
A little off topic, but open source != better security. take a look
-
Mirrors
-
Mirrors
-
Mirrors
-
Mirrors
-
Mirrors
-
Mirrors
-
The important facts
This is a very high impact vulnerability, mod_php is the worlds most popular Apache module, maybe the most popular web script language. (no flamewars intended, it IS popular among a lot of people whether you like it or not).
However, one line in the config should according to php.net disable the vulnerability :
file_uploads = off
(When tested phpinfo(); gives "no value" at my site)
One file needs to be patched for all PHP versions, get the patch here :
php.net/downloads.php
Patch like this:
1. Enter ../src/php-4.0.x/main dir
2. patch < pathtodiffile/rfc1867.c.diff-4.0.6
3. build either the DSO module or build apache with static php
The "full" advisory is here :
security.e-matters.de
now, PATCH! -
[OT] That would be a good signature line.
If you feel the sudden need to program, there is always PHP.
And I agree.
-
best lango, best algoThe Best language is the one that allows you to do the things you need fast - and addapts to the environment the app will run in.
It's the one that allows you to be more productive.
It's the one that has lots of code base for you to rip.
It's PHP.
With PHP-GTK you can create GUI apps. There's also a SDL port for you to do graphic things with PHP. Imagine wining that demo-competition with a scripted demo.
http://www.php.net http://gtk.php.net
Even Microsoft put a team of coders working on PHP for Windows. They even managed to create a couple of security probs there :) :P
-
best lango, best algoThe Best language is the one that allows you to do the things you need fast - and addapts to the environment the app will run in.
It's the one that allows you to be more productive.
It's the one that has lots of code base for you to rip.
It's PHP.
With PHP-GTK you can create GUI apps. There's also a SDL port for you to do graphic things with PHP. Imagine wining that demo-competition with a scripted demo.
http://www.php.net http://gtk.php.net
Even Microsoft put a team of coders working on PHP for Windows. They even managed to create a couple of security probs there :) :P
-
Re:oh come on
You're forgetting that there are a lot of people that for one reason or another do not want to code in C++. Exactly because GTK+ was written in plain C there now exist a multitude of language bindings, far more than Qt offers at last count (PHP-GTK anyone
:) I'm, actually writing a small GUI for log parsing and I like it!). The bindings haven't been perfect in the past, but they are becoming pretty mature now and a lot of applications are being written against the GTK-- C++ bindings for example. I also expect the GTK+ libraries to adapt far better to languages not even on the horizon yet, while I expect most Qt developers to stick with C++.
In the end, score one for choice, because at the end of the day we've got two excellent toolkits to choose from. I'm looking forward to learning and programing more with Qt. -
Re:Its nice for what it does, but hardly a revolut
php also has built-in PDF editing and creation functions as well, FWIW.
And here's the PDFlib for Perl which allows much of the same functionality (create/modify)
Also, last time I checked, I could still edit PDF files in Acrobat (authoring suite) or Illustrator.
I also remember programming a bit of Postscript in college as well... do PDF/PS really qualify as closed architectures?
-
Re:I hate MS
Go look at PHP if you want something closely integrated with a database, etc. Makes weblog creation, etc, as easy as reading the (extremely good) documentation available on PHP. ASP sucks by comparison (not necessarily because it's bad, but because at the end of the day it's a royal pain in the arse to debug other peoples' time-expired ASP.
-
Re:No fame
Every time someone talks about PHP I make a comment about how great the documentation is. It's free, it's clear, it gives examples, it's just great all around. Kudos to the PHP writers!
PHP Online Docs -
Re:A new slashdot record
To be fair Apache does not do PHP Auth, PHP Redirects, PHP parsing, or anything else with PHP. Not until you install the PHP module. If you're going to install the PHP module under Apache then you have all the tools you need to compile PHP in NSAPI form and have it run under NES/iPlanet.
[PHP Doc Here] -
Re:GTK
-
Re:GTK
-
Do you want to design using a Gui or by coding?
If you want to be able to produce flash from code, php has an excellent libswf module written by Paul Haeberli. The docs are located here. Of course, this doesn't give you a fancy gui to develop from, but it is flexible
:) -
bugs and version differences...
...is what breaks autoconf and makes it often unusable.
Look at the PHP project. They use autoconf. Yes, it (autoconf) works most of the time pretty good for PHP.
However, you can use only certain versins of it because the older versions do not have the necessary features, and the new ones break BC or just plain have bugs that prevent PHP from building with that new version, so you are often locked in to a certain couple versions of autoconf, which is one of the main problems autoconf is supposed to fix in the first place.
It does contribute a bit to developer frustration, but, in the long run, it is much better than most other things I have seen so far, so it's probably not that bad of a choice after all...
:) -
Re:Astoundedanother example of security through obscurity.
No. Mac may have some "security through rarity", but OS X is not obscured. Neither are its web services nor its SQL implementations.
So I have to ask, what are you talking about? -
PHP for sure
PHP is an open web scripting language, and IMHO will replace ASP because of this. Beyond that, ASP will make it hard to work without buying all kinds of crap from MS.
Get an Apache server with MySQL and PHP modules running, then walk through the PHP.net Annotated PHP Manual which is all you really need to learn PHP. The annotated manual allows students to post questions or comments right on the manual to get help from PHP Experts or share their insights. There's a bit of "how to MYSQL" in there, but without some kind of database backend, you've just got static HTML pages that really don't do much. Apache also has ways to setup directories for each student to publish to.
If you want to give students something extra, point them to a good shell scripting tutorial so they can write and run their own server side scripts, which can be called upon by PHP. another good link for HTML tutorials is webteacher where they can follow some basic HTML lessons. Above all, don't make them need a textbook, this is the new age, we have no need for paper as connected web developers, and don't teach them something they'll have to pay to use in any sense like ASP.