944,179 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Unsolved
  • Views: 1691
  • Python RSS
You are currently viewing page 1 of this multi-page discussion thread
Nov 2nd, 2009
0

Python CGI vs PHP

Expand Post »
I am currently reading two books, one on PHP and one on Python. Not that I'M good at ether. I'M about half way through the book on PHP or less and almost done with the one on Python. Though I haven't actually read anything web related in this particular Python book, I am aware that it can do web programming. My question is, which is better. Could I should I go ahead and drop the book on PHP considering that Python can do web programming as well as regular computer programming? Or does PHP have enough of an advantage to keep it up as well? Thanks.
Reputation Points: 10
Solved Threads: 1
Junior Poster
Garrett85 is offline Offline
190 posts
since Oct 2009
Nov 2nd, 2009
0
Re: Python CGI vs PHP
I think both would work really well, but you'll have an easier time getting support if you're using PHP because that is a very common setup. PHP makes it really easy to grab the form fields and it might not be that easy in python. There are tons of directions on how to make Apache or IIS run PHP apps, but you'll have a more difficult time finding instructions on doing it with python.

Just my thoughts. It's probably not as difficult as I make it sound.
Reputation Points: 16
Solved Threads: 35
Junior Poster
mn_kthompson is offline Offline
148 posts
since Nov 2007
Nov 2nd, 2009
1
Re: Python CGI vs PHP
I haven't worked with Python, but I work with PHP and JSF. If your focus is just on web programming I'd recommend PHP. But you should always keep in mind to choose the correct language for your solution.

PHP is a good choice because it's specifically made for the Web and as such has massive support and is easy to setup with other web related technologies. It also has a pretty large collection of libraries that you can just drop into the ext folder and use.

Don't stick to just one, use the best tool. Being loyal to one language is nice, but it won't get the job done.
Reputation Points: 13
Solved Threads: 19
Junior Poster
jomanlk is offline Offline
103 posts
since Oct 2009
Nov 2nd, 2009
1
Re: Python CGI vs PHP
You can have a look at this to have an idea of web programming in python
http://webpython.codepoint.net/
and this
http://webpy.org/
I've never done web programming in python because norm in my job is php so i had to learn php. And i find it much less pleasant to write.
If I had choice, i'd certainly give a chance to python because it's very pleasant and fast to write.
Reputation Points: 64
Solved Threads: 56
Posting Whiz in Training
jice is offline Offline
225 posts
since Oct 2007
Nov 3rd, 2009
0
Re: Python CGI vs PHP
I am working with python on web applications from 2002. For the most I use Zope and Plone on it (a CMS). It is not a common choose because the object database backend, but there are al lot of python framework using the standard way of a relational DB: Pylons, TurboGears and Django (the most notables). All these frameworks can easily integrated wich Apache or other web server, but you need a hosting that provide python or a complete server.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
axaroth is offline Offline
4 posts
since Nov 2009
Nov 6th, 2009
0
Re: Python CGI vs PHP
Python is easy to write, but I find setting it up for even local development is a headache! If it is such a headache to Just setup it, how can I practice?? For this one, I suggest PHP. PHP isn't difficult either though it is C++ish
Reputation Points: 462
Solved Threads: 392
Senior Poster
evstevemd is offline Offline
3,681 posts
since Jun 2007
Nov 6th, 2009
0
Re: Python CGI vs PHP
Click to Expand / Collapse  Quote originally posted by evstevemd ...
Python is easy to write, but I find setting it up for even local development is a headache! ...
Under linux you have Python by default. If you need to experiment with libraries and don't want to mess the system, Python has virtualenv, installable as package. If you want to try the last version compiling Python from sources takes 10-20 minutes... maybe under Windows is another story, I don't know.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
axaroth is offline Offline
4 posts
since Nov 2009
Nov 8th, 2009
0
Re: Python CGI vs PHP
Click to Expand / Collapse  Quote originally posted by axaroth ...
Under linux you have Python by default. If you need to experiment with libraries and don't want to mess the system, Python has virtualenv, installable as package. If you want to try the last version compiling Python from sources takes 10-20 minutes... maybe under Windows is another story, I don't know.
I meant to set it up for Web applications. I use windows.
I have Installation and works fine for desktop apps
Reputation Points: 462
Solved Threads: 392
Senior Poster
evstevemd is offline Offline
3,681 posts
since Jun 2007
Nov 8th, 2009
0
Re: Python CGI vs PHP
Click to Expand / Collapse  Quote originally posted by evstevemd ...
I meant to set it up for Web applications. I use windows.
I have Installation and works fine for desktop apps
Usually the python frameworks have its web server so under Linux we install the available package for Apache and use it only as a proxy and only on production machines. mod_python and mod_wsgi are used from few people.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
axaroth is offline Offline
4 posts
since Nov 2009
Nov 9th, 2009
0
Re: Python CGI vs PHP
Click to Expand / Collapse  Quote originally posted by axaroth ...
Usually the python frameworks have its web server so under Linux we install the available package for Apache and use it only as a proxy and only on production machines. mod_python and mod_wsgi are used from few people.
I tried to set up mod_python to work with WAMP so as to use PHP/Python side by side, and guess what? I ended giving up. The process is so convoluted that It was only headache to me. Not so fun!
Reputation Points: 462
Solved Threads: 392
Senior Poster
evstevemd is offline Offline
3,681 posts
since Jun 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: simple question
Next Thread in Python Forum Timeline: Working with files





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC