Domain: php.net
Stories and comments across the archive that link to php.net.
Comments · 1,658
-
PHP 4.2.3 and Apache 2.0.42 does work
I read a comment by one poster saying that PHP 4.2.3 did not work with Apache 2.0.42 on win32. This is not true! Once you have Apache up and running, install PHP 4.2.3 (or what ever the latest PHP distribution is). If Apache wont start, follow these directions.
1) Move php.ini to your {winnt} directory.
2) Move php4ts.dll and php4ts.lib to your {system32} directory.
3) Go to Snapshot and download php4-win32-latest.zip
4) Extract the file php4apache2.dll from the downloaded file to your folder, overwrite the old file.
5) Restart Apache!
When ever PHP seems to break the latest Apache release just repeat this process. If this still does not work try asking for help over at Install Forum -
Some other important AppsThese are mostly server orientated - but they're free, and compile on windows: Apache, PHP and MySQL.
Also a very addictive game called crack attack, which runs on windows and linux, and is under the GPL:
Crack AttackOther things that you should consider include Python and PyGame (don't forget SDL as well!).
[x]Chat runs under windows (native), and is the only irc I'd consider using (beats the hell out of mirc).
Putty is an open source ssh/telnet client. Its possibly the best telnet client for use under windows. Then again, could anything be worse than C:\Windows\Telnet.exe ?
I've probably missed quite a few good ones, but these are things I seriously like.
-
"We will outsmart..."
We will outsmart OpenSource....
Read as:
We will outsmart, PHP, Perl, MySQL, OpenMosix, Apache, Audacity, Crystal Space, MiKTeX, SDL, Vega Strike, X-Tractor, FileZilla, ... (yes most of this also runs, if not exclusively, on windoze).
Or:
We will outsmart freedom and choice.
Somehow, I don't see it. Then again, a lot of money can buy a lot of laws.... -
Re:Remote Object Calls.The fact that you used a database abstraction layer might save you 10 minutes of global search and replace on some db-specific function calls...
Frankly, you're wrong. I've made $LARGENUM over the last six months migrating a few websites from legacy Interbase servers to newer Postgresql systems. The process was far more complex than it needed to be, especially since the SQL itself was very simple on each of the sites (no transactions, no views, nothing complicated). Why?
- In Interbase, you can do stuff like:
while ($foo = ibase_fetch_row($resultHandle)) { ... }
but in Postgresql, you have to:
$max = pg_num_rows($resultHandle);
for ($i = 0; $i { $foo = pg_fetch_row($resultHandle, $i); ... }
- When converting between MySQL and Postgresql, the inconsistencies are even more annoying. Check out
pg_query versus mysql_query. Note that while the functions are nearly identical, the order of the parameters is swapped. Who the $#!$@# thought that was a nifty idea?
In other words, it's pretty much impossible to swap out a project's backend once you've started.
No, I've relegated PHP to the "toy language" category. Can it be useful on occasion? Sure. Will I use it to whip up a comment submission form or similar lightweight interface? You bet. But there's no way, ever, that I'll even consider PHP for serious development work in the future.
- In Interbase, you can do stuff like:
-
Re:Remote Object Calls.The fact that you used a database abstraction layer might save you 10 minutes of global search and replace on some db-specific function calls...
Frankly, you're wrong. I've made $LARGENUM over the last six months migrating a few websites from legacy Interbase servers to newer Postgresql systems. The process was far more complex than it needed to be, especially since the SQL itself was very simple on each of the sites (no transactions, no views, nothing complicated). Why?
- In Interbase, you can do stuff like:
while ($foo = ibase_fetch_row($resultHandle)) { ... }
but in Postgresql, you have to:
$max = pg_num_rows($resultHandle);
for ($i = 0; $i { $foo = pg_fetch_row($resultHandle, $i); ... }
- When converting between MySQL and Postgresql, the inconsistencies are even more annoying. Check out
pg_query versus mysql_query. Note that while the functions are nearly identical, the order of the parameters is swapped. Who the $#!$@# thought that was a nifty idea?
In other words, it's pretty much impossible to swap out a project's backend once you've started.
No, I've relegated PHP to the "toy language" category. Can it be useful on occasion? Sure. Will I use it to whip up a comment submission form or similar lightweight interface? You bet. But there's no way, ever, that I'll even consider PHP for serious development work in the future.
- In Interbase, you can do stuff like:
-
Re:register_globalsYou are half correct...
Please note that register_globals cannot be set at runtime (ini_set()). Although, you can use
Taken from the manual .htaccess if your host allows it as described above. An example .htaccess entry: php_flag register_globals on.Another workaround is this:
if (ini_get('register_globals') != 1) {
extract($_ENV, EXTR_SKIP);
extract($_REQUEST, EXTR_SKIP);
extract($_SERVER, EXTR_SKIP);
} -
Re:thanks for the link
Their stats show the same trend in just about every Apache module except Perl. I suspect it's due to the recent slump in the economy sinking dot.com and other businesses.
Also, Netcraft's survey shows steady increase in usage. -
Re:Remote Object Calls.
Me too.
:)I work for a Fortune 50 (no, there isn't a 0 missing off that) company and we use PHP quite a bit internally. I also do some freelance web work in my spare time with a friend who is a designer with no coding experience, and even he can get the basics of an interactive site together using PHP (provided I go in afterwards and secure things afterwards - sorry, Joss!)
:)PHP is fast, easy to use, feature-rich and well documented. Development of most simple interactive pages almost feels like cheating because there's generally a built-in function for anything you need to do. Now with the availability of database abstraction and templating most of my old complaints about it have been addressed and I find myself working with it more than Perl.
-
TipPHP's online documentation is excellent. Their website has this very useful feature where you don't even have to have a window open to it when you're doing web development: simply type in the name of the function you want:
www.php.net/mysql_query
www.php.net/strftimeI've found this most useful: you only have to type a few more keys besides the function name to get the documentation, kind of like man pages.
-
TipPHP's online documentation is excellent. Their website has this very useful feature where you don't even have to have a window open to it when you're doing web development: simply type in the name of the function you want:
www.php.net/mysql_query
www.php.net/strftimeI've found this most useful: you only have to type a few more keys besides the function name to get the documentation, kind of like man pages.
-
Alternate Resource
I've always found php.net to answer all of my questions very effectively. The online manual has everything a manual should, plus additional comments from users. The comments contain everything from hints about how to use a function to complete code samples. Many other programming languages could benefit from similar sites.
-
I saw this
The other day while I was waiting for a friend a Barnes and Noble, I picked it up only to put it back on the shelf ten minutes later. Usually I buy every Oreilly book for technologies that I use frequently, but I figured that there is probably very little in the book that PHP's excellent online documentation doesn't provide.
-
Useful, but not necessary
As a semi-competent Perl hacker I found PHP very easy to pick up, and I imagine the same would be true for anyone with some degree of coding experience. The only reference I find myself using regularly is the excellent PHP website which provides a pretty decent tutorial and a thorough and searchable command reference. Combine that with the fact that the manual is annotated by PHP users and the only reason for having a dead tree reference is to have something to read in the bath.
Still, buying it does at least give Rasmus some money...
-
Re:Good point on PHP
I agree with the part of PHP being proud of the wrong thing and embedding business logic within the presentation logic.
Of course, you could use The Smarty Template Engine to do some of the work that the Template Toolkit does. -
Re:Good point on PHPAlthough it's true PHP is designed primarily for web scripting, you can use PHP just fine as a non-HTTP language. The PHP engine can be called on the commandline to process a script without generating HTML-only output.
PHP has extensive file handling capabilities and other stuff like virtual image handling (create a
.GIF or .JPG in memory as a "canvas" and then draw all over it and save it to disk) that make it excellent for doing back-end tasks as well. You could write your output to a file or connect to a remote machine and send it through a socket. And the DB support is excellent -- I've used it with MySQL and MS SQL Server and was very impressed with the results.
Coming from a C/C++ and Delphi background, I appreciate PHP's "similar-to-c" style. It makes it easier for me to get code up and running without having to spend enormous amounts of time learning a new language. And PHP has OO built-in so it jives with my Delphi and C++ experience.
There's a good comparison between PHP and other scripting languages here. (ok maybe a little biased since it's on the PHP site!)
-
Re:ultimate reference bookcase...
I thought JSP, Servlets and MySQL had some good JSP and MySQL content in it.
If you're looking to learn PHP, you should check out the documentation on PHP.net.
If you want to learn ASP, try Planet Source Code.
Step one is to decide on the platform and language you want to learn first. They all have their advantages and disadvantages. -
Apache 2.0 goes nowhereAdoption rates for Apache 2.0 will continue to be slow until things like PHP are supported.
No way until then.
Yeah, you can "get it" to work, but when it's good and production stable then I'll consider it...
-
Information Organization
One of the best developer resource sites I have ever used is www.php.net for the main fact that information is organized and easily accesible. The documentation and comments are well maintained.
-
Information Organization
One of the best developer resource sites I have ever used is www.php.net for the main fact that information is organized and easily accesible. The documentation and comments are well maintained.
-
What about Ruby and PHP?
So Larry, it's pretty clear to me and all my collegues that Ruby and PHP are gradually taking over everything that is currently written in Perl. What are your thoughts on the inevitable short lifespan Perl now has?
..and from what I understand most all the current reg-ex stuff will have to be relearned in Perl6, who do you think has time for that?
These are serious issues Larry. Just the other day I saw an IBM job listing for "Perl/Ruby Programmer needed."
-
Re:Isn't it time web development moved on?
Speaking of database calls, why is there zero abstraction in PHP? why do I have to find and replace every function call to change databases.
Have you heard of Pear DB?
What is PEAR?
Good Luck. -
karma whore strut...
Also seriously flawed in that you need IE on Windoze to use its web access features.
[Leave it to MS to never miss an opportunity to turn a great concept on its head to leverage the rest of their product line:) The folks at MS who actually implemented the web access feature in Project must have had the breath knocked out of them at the "IE specialization".]
Nevertheless, the concept of web based project management is still a really good one. Not only for read-access to view what's going on, but also to help formulate project plans.
I prefer to spend my time programming, but have had brushes with project planning exercises and noted the dearth of good open source alternatives to MS Project (which, practically, seems to require some training in order to learn the quirks of how to use it.)
The most intriguing development I've seen is out of the Horde Project (a PHP framework for web applications).
They mention something called Nag that came out 1.0 on June 11 of this year, but I don't know what it's really like.
But I can see where having an XML database for projects that is accessed via PHP would be a good thing. That, and having some SVG enabled browsers (and server code) to create and view Gantt charts on the fly.
Since I'm throwing buzzwords and wishlists about, I may as well suggest that WebDAV would be a great part of such a tool because it would offer a good means for collaborative authoring of project plans, which is really how the best ones get done. (The worst ones are guesses and dictats that make everyone mad.)
-
Re:Something tells me I shouldn't be doing this
It also looks like the us3.php.net mirror is working... the download page can be had at http://us3.php.net/downloads.php.
-
Good Websites & BooksWebsites
- http://www.phpbuilder.com - PHP, some real world examples.
- http://www.devshed.com - PHP, Perl, Python and more.
- http://www.php.net - PHP
- http://www.perl.com - Perl
- http://www.coveryourasp.com - ASP, all real world examples.
- http://www.builder.com - C, C++, Java, Perl, Python and more.
- http://www.devcentral.com - C, C++, Java, PHP, Perl and more.
- http://www.eskimo.com/~scs/C-faq/top.html - C FAQ.
- Programming Perl - Perl
- The C Programming Language - C
- The C++ Programming Language - C++
- PHP and MySQL Web Development - PHP and MySQL. All real world examples.
-
Re:PHP, go to the source
Or, if you're like me, and have very little bandwidth, rsync a copy of the php.net website onto a local webserver and use it from there. Sure, it takes a while to mirror, but it saves soo much time when you're trying to find out how to use a function. Plus, mirroring it gives you access to the comments in the documentation(one of the best things about the php documentation, helps out in soo many ways), something that you miss out on by downloading a pdf (or one of their other many formats avaliable) version of the manual.
Mirroring details here -
PHP
When I decided to learn PHP, I just grabbed a copy of the documentation from the php.net website and started looking at code that can be found around on the net.
Sometimes the best way to learn a particular language is by example and trial-and-error
-
These ones belong in the personal toolbar:
Java API
PHP Manual
Can't go wrong with those. -
some quickies...
PHP: PHP.net
Comments: If you've got a programming background, this website is all you need. If you don't have a programming background, an introductory book and this website is all you need.
HTML, Javascript, DHTML, XML, DTD, etc.: W3Schools.com
Comments: Good introductions to a ton of topics on the left-hand side.
SQL: SQLCourse.com
Comments: The first place I ever pointed my students to for SQL and probably the perfect quick source for anything up until the level of stored procedures, transactions, etc., which vary depending on the DB implementation anyway.
C++/C/Java textbooks: ACCU.org
Comments: Lots of book reviews on a bunch of topics. To be honest, I still haven't seen a website that covers these three languages as well as good books do.
After all this, hone your google and google.groups skills and you should be able to solve any problem. -
Best...Best books: O'Reilly. Did you really need to ask? If you've not come across O'Reilly books yet, it's simple.
- Go to book store.
- Find computer section.
- Find white book with nice sketch of animal (ignoring the weird photo ones) on the cover.
- Find one that matches whatever you want to learn.
- Buy it.
As for PHP, the best resource for that is the plain and simple php.net. Not only is the entire language documented, every function definition contains examples and discussion on it. What more could you ask for?
-
Re:For PHP...
Use this site for learning php. The manual is quite helpful.
-
Web Developer Resources
Your question is rather broad and lacks any specifics, but I get this feeling you're looking for information regarding web site programming, hence the "My intention is to ask about web sites this weekend". In that case:
Sitepoint
A fantastic web site dealing with everything from learning new programming languages to design ethics to search engine tips.
Cool Home Pages
Stuck? Out of ideas? Check out some other fantastic designs. "The only known cure for designers block"
PHP.net
Even though it's the languages official site, there is a wealth of information here. Every function is very well documented and you'll recieve a ton of information.
PHP Builder
Possibly the single best resource to ask your questions - but before you do that, search the forums. Chances are your question has already been asked and has a fantastic answer.
w3schools
Great resource for all things HTML, CSS and so much more. Remember CSS is your friend on the internet - print the quick reference!
And if you're looking to getting into some open source databasing:
MySQL
Once again, the developer of an open source project has a fabulous web site just rigged with useful information.
-
Some Starter Sites
HTML Help
WASP would be a good place for all newbs to start.
WASP
Find Tutorials is a good general tutorial finder.
PHP
First LAMP tutorial
PHP.net
PHP Help
There are tons of good .asp sites out there, but my guess is that's not what slashdotters are looking for.... -
PHP, go to the source
I owe my job to the wonderful
online documentation at php.net
php documentation
I have bought a few PHP books,
and nothing compares to having
a bookmark to the online documentation.
I have noticed, that books tend
to write examples in an OO style,
and that is not something that
comes across from reading the
code snippets in the comments
in the online documentation. -
Re:from the terms and conditions
Good question. The only way I can think of is to grab the output of microtime() every time an API call is made and record that time in a database (or on the filesystem, but a database would be preferable for performance reasons). Then you can check this "last queried" time before making a request, and if one has been made in the last second you can use usleep() to temporarily delay your next request. You would probably have to code in some kind of method of spotting when you are getting really high traffic (continuously getting several hits a second) and have some clients die with an error message, rather than wait for potentially quite a long time before their turn to send an API request comes.
Caching the results of requests could help greatly of course...
-
Re:from the terms and conditions
Good question. The only way I can think of is to grab the output of microtime() every time an API call is made and record that time in a database (or on the filesystem, but a database would be preferable for performance reasons). Then you can check this "last queried" time before making a request, and if one has been made in the last second you can use usleep() to temporarily delay your next request. You would probably have to code in some kind of method of spotting when you are getting really high traffic (continuously getting several hits a second) and have some clients die with an error message, rather than wait for potentially quite a long time before their turn to send an API request comes.
Caching the results of requests could help greatly of course...
-
Re:Perl vs. PHP
-
PHP4 Easter Egg
Append "?=PHPE9568F36-D428-11d2-A769-00AA001ACF42" to the end of any php page running PHP$ gives a goofy picture of one of the PHP developers.
-
Re:Yes, but complain to the site ownerI have a five-year-old who knows that smoking is bad. I didn't plan it this way, but she's a militant anti-smoker. When she sees someone smoking, she says, "You need to quit smoking or else you won't live very long." Then we have my co-workers, many of whom are smokers. Go figure.
Now we have a self-described high school webmaster wannabe who knows enough to adhere to standards while the so-called professionals are flipping through their MS certification study guides, so they can lookup which JavaScript hacks work with which versions of IE. Meanwhile, we're all chuckling about prosecution exhibit A.
Seriously, if you are really as described, check out the following:
Every once in a while I stumble across a little piece of evidence that suggests we're not all doomed to lifetime of watching the results of other people's bad code. I hope your approach to coding is matched by a healthy appreciation for Linux and all the other Open Source goodies.
-
Donate to PHPIt is better than Perl.
Thank you.
-
PHP + MySQL = use ADOdb
For those who use MySQL or other database systems with PHP, I highly recommend using the ADOdb Database Library for PHP. It's feature-rich, robust, and has a smaller and smaller footprint with nearly every successive version. I use it all over the place, and it's very very handy. Sure, there are other abstraction libraries out there, but this one takes the cake, IMO. Check out all the supported database drivers!
-
Drop them!
Drop the vendor: they obviously haven't got a clue what they're talking about.
1) They should read their vendors' EULA's (and probably their own). No software these days is supported. ("This software is provided "AS IS"...).
2) Lots of free software is very much industry proven.
Perhaps you could try a little education. -
Re:Graph Layout? GraphViz of course!GraphViz might help you out...
graphviz is a set of graph drawing tools for Unix or MS-Windows (win32), including a web service interface (webdot). Source code and binary executables for common platforms are available. Graph drawing addresses the problem of visualizing structural information by constructing geometric representations of abstract graphs and networks. Automatic generation of graph drawings has important applications in key technologies such as database design, software engineering, VLSI and network design and visual interfaces in other domains.
There are modules/packages availible for PHP HERECheck it out... It might be what you're after.
-
Re:Does anyone care?
Howsabout some Stuff That Matters? Jeez... at least timothy posts amusingly trollish crap. pudge... well really, does anyone give a fuck about minor point releases of scripting languages used by the three people worldwide who found Python too difficult to get their heads round?
Actually, AppleScript isn't really easier than Python. Even for non-programmers, I would be willing to bet that most people find Python easier to learn and more intuitive -- AppleScript has an "English-like" syntax (as its marketing says), and English is actually one of the most inconsistent and hardest languages to learn (for those who are not raised speaking it). Why? Because there are so many different ways to say the exact same thing in English, not just synonyms but the grammatical structure itself -- very unsystematic. I find that the same thing is true of AppleScript. This is often leveraged against Perl by those who would criticize it as being difficult to learn (in comparison with PHP or Python, for instance).
Whereas Perl and AppleScript provide "more than one way to do it", Tim Peters praises Python saying There should be one-- and preferably only one --obvious way to do it. Anyone who's written an AppleScript can tell you this is definitely not true of AppleScript.
Besides that, AS hooks nicely with scriptable apps on the Mac. It even lets you call shell scripts and other languages' scripts directly. I don't use AS much, but one of my favorite little tools is a script I incorporated into my text editor ( BBEdit ) -- I highlight a function name and hit F8, and my web browser pops open and serves me the man page for that function (using php.net's awesome URL-based function lookup.
No, none of this really matters for non-Mac users, but then why are you reading apple.slashdot.org if you're not interested? Besides, as you can see from the release number, it's not like AppleScript has been updated much in its 14+ years of existence. For Script-savvy Mac users, this is "news that matters".
-
PHP 4.2.1 / Apache 2.0.39
PHP 4.2.1 doesn't seem to work with Apache 2.0.39. You need to upgrade to the CVS version of PHP; see the bug report
-
Interenet
Nothing better than the internet. My favorite is devshed. They have great forums if you're looking for help in just about any IT topic. There is also PHP documentation and Mysql documentation.
-
Re:Fix for 1.3.x tree?
-
SMARTY! (Re:PHP Templates)
I couldn't agree more. I found phpLib to be a bit slow and awkward and found smarty. Honestly, use whatever you want, I just like their approach and it has a number of groovy features. Smarty is one of the more efficient templates I've found because it compiles your code and templates into pure php, making them really, really fast. It even has the option to cache your pages, which is super smart.
I'm a lone gun in my operation--I have the severe misfortune of being the designer/programmer/db admin. The only thing I don't handle is the server setup, but those guys are MCSE's that insist on using Windows 2000 and IIS, so I'd gladly take that job to use a real OS. Regardless, I still use templates to make my life easier (an anyone that has to read my code!) -
Database abstraction classes are available
Not sure if these are the efforts you're referring to but they're available for some of the more widely used backends (MySQL, Postgres, DB2, ODBC).
Yes, there are arguments to be made against DB abstraction layers if you're using very specific features on one platform that might not be available on another (e.g. Postgres' foreign keys and subselects vs. Mysql's lack of them (er, last time I used MySQL anyway))
But if you're doing fairly run of the mill SQL stuff, check out the PEAR DB class or ADOdb. Either one implements a standard set of methods for interacting with databases regardless of the backend. -
Re:I *hate* DB programming in PHP!Take a look at PEAR's DB abstraction layer:
-
PEAR DB abstraction
There is the PEAR DB abstraction layer if this is important to you. I believe there are also a number of other DB abstractions out there for PHP. It's not quite to Perl's level, but it's getting better and better all the time, so it's really not fair to just ignore it.