PHP, CHẠY CHƯƠNG TRÌNH ĐẦU TIÊN TRONG XAMPP

*
#PythonIsSexyAgain #NowPictureGuidoVanRossumNaked #SEXY? #NowTryGettingThatPictureOutOfYourMind #GlobalInterpreterLockAmIRight?#IsAProgrammingLanguage#EverythingIsAwesome #JavaCanDoEverything #JavaIsAwesome #NoWaitMaybeNot#AtLeastPHPIsNumberOneAtSomething#YouCodeForTheLOLsICodeForTheLULZ#EveryTimeATabIndentsOneThreeOrSevenSpacesGetTheirWings#OneTypingToRuleThemAll(There are many other gems in there, like any good tragicomedy.)


Answered in Quora:

Q: Why should I learn the combination of Python/Django rather than PHP, JS/Node? I am a web designer moving khổng lồ web development. What is the scope of Python/Django?

Python/Django is lượt thích learning Ruby/Ruby on Rails. The equivalent in the PHP world would be PHP/Drupal or PHP/Laravel. Equivalents in NodeJS is not Node/JS but NodeJS/Meteor or NodeJS/Sails. In all those examples above the first part would be the underlying web language, & the second would be a MVC framework on vị trí cao nhất of the language.

Bạn đang xem: Php, chạy chương trình Đầu tiên trong xampp

(There exist website frameworks that vày not provide MVC but just the website server & HTTP request-response plumbing. This isn’t common in PHP since it is embedded in a web vps such as Apache or nginx, but in Python it would be flask and in NodeJS it would be Express or Koa— these are sometimes referred khổng lồ as “microframeworks.”)

However, unlike on the front-end with things lượt thích Vue.js, React/Redux and AngularJS, full-service MVC web frameworks have increasingly less utility on the back-end. This is because most the the advantage a framework provides is to vị heavy-lifting of tedious but repeatable tasks that require a lot of code (very common when building a user interface) the bulk of which has been moved onto the client in web development. What value is a MVC’s templating system và router when both have moved into javascript on the client-side & all interactions are through an API? This becomes more extreme with standardization of the data interface (a la GraphQL) & the prevalence of more service-oriented architecture popularized by microservices or serverless FaaS architectures.

MVC web-frameworks still provide things such as a configuration management, a data object mã sản phẩm and abstraction, but even those can get in the way as a website becomes more mature & this pre-fab approach becomes a hinderance lớn future scalability and optimization.

Also, when not building lớn scale or building proof-of-concept, a full MVC architecture will help you starting out on server-side web development because it does all the heavy lifting for you. So it might be good to start out with one, though YMMV (your mileage my vary).

Continue reading about the state of web frameworks after the jump


Answered in Quora:

Q: What is the easiest/fastest way khổng lồ set up AWS khổng lồ repeatedly run a small Python or PHP script (24×7)?

Probably the easiest way is khổng lồ use Lambda. It has a built-in scheduler và you only pay for the time it is running. (Note that in PHP you have to create a lambda package using this tutorial or via node Serverless here.)

If you mean continuously, and not repeatedly, then the caveat for PHP at least, it is a bad idea to have it repeat forever in the process because it was designed lớn be phối up & torn down và might leak memory (with the proper setting lớn set_time_limit & ignore_user_abort, have it run forever). In those cases you would have something else constantly hotline the php script via command line và restart.

Other than that, whether PHP or Python or whatever, it is better to create a non-burstable EC2 instance & run it, since it will always have some load. You can write something simple to lớn the crontab that will make sure the process is always running or, better yet, use forever.


Answered in Quora:

Q: What’s something very few people know about PHP?

It is mind-bogglingly popular for web development. That popularity hasn’t diminished even though conventional wisdom says otherwise…

Over a decade ago, I said about 40% of the đứng đầu 100 websites use PHP — a number I pulled out of my ass — but nobody (not even the Ruby on Rails developers I pissed off) argued with that spurious claim. In 2009, Matt Mullenweg, the creator of WordPress became curious with my claim and did a survey of Quantcast’s đứng đầu 100 sites — he got almost exactly 40. Even today, among the 10 most important websites, four use PHP as their language of choice — 40% again.

Xem thêm: Sửa Lỗi Youtube Tivi Asanzo, 04 Tải File Sửa Lỗi Youtube Tv Asanzo

Overall, almost 80% of the internet is powered by PHP, và that has held steady for years! Newer website languages such as Ruby or NodeJS have only grown at the expense of other languages such as ASP, Java, or Perl.

Just one single application written in PHP, WordPress, is used by over 30% of all websites on the entirety of the internet. That’s more than double the market nội dung since back when I last worked at Automattic/WordPress in 2011! It grew until it saturated its entire market — over 60% of all CMSs. In the CMS market as a whole, PHP-based CMSs occupy positions 1, 2, 3, 6, 7, & 8 in the đứng đầu 10. The most popular non-PHP-based CMS is both closed source & sitting at only a 2.5% share.

It was estimated back in 2009 that there were 5 million PHP developers worldwide. It’s difficult to make this estimate today, but it’s obvious that that number has also held steady or grown.

These last few years, I’ve been commercially working in Ruby (on Rails), GoLang, NodeJS (for static servers), and Python (Django), but PHP is still also my love in that love/hate relationship.

Come see my talk in February 2019 at SunshinePHP in Florida!


Answered in Quora:

Q: What don’t you lượt thích about PHP?

It’s a ball of nails with almost no súc tích to it. From the perspective of software language kiến thiết — as Tim Bray, co-creator of XML và at the time Directory of Sun Microsystems’s website Technologies division, once said — “PHP is soul destroying.”

To take one of the most notorious examples: strpos & in_array.

In one, the order of variables is $needle, $haystack in the other it is $haystack, $needle. I challenge even the best PHP developers to lớn remember which it is without a reference. Also, even though they both serve the same purpose they return different things và don’t obey a consistent naming convention: they should be named strpos/arrayin, posinstr/inarray or `str_pos`/`array_in`. That’s three terrible thiết kế choices in one single example!

Another example is the namespace separator in PHP is what is an escape sequence everywhere else \. Why? Because by the time PHP added namespaces, they had run out of ASCII symbols for the lexer.

I could go on and on, but I won’t.

I love the language sometimes because I hate it so much.