Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Saturday, September 28, 2024

PHP for Web Developers, Advanced Concepts and Best Practices

PHP, which stands for Personal Home Page or PHP Hypertext Preprocessor, is a specialized scripting language designed for creating dynamic web content that is executed on the server side. It's also considered a reflective programming language used to execute scripts on the server side, although it can also be used with the command-line interface or through a standalone graphical application. It has always been an alternative to commercial programming languages like Java and others. Incredibly, PHP originated in 1994 as a set of CGI binary files in the C programming language, coded by Danish programmer Rasmus Ledorf to replace Perl scripts on his personal webpage. Officially, PHP made its appearance on June 8, 1995.

Behind it today stand The PHP Development Team, Zend Technologies, the PHP Foundation, and millions of users. It is estimated that over 76% of websites on the Internet are powered by PHP in some way. By default, PHP files end with the *.php extension. Sometimes, a portion of PHP code is embedded directly into HTML pages; together with HTML, but best practice is to separate PHP from HTML into a separate file. When the server encounters a PHP header <?php and code in PHP; or a file that ends with *.php; it automatically passes the entire file to the PHP processor. The result is that your web browser will only display HTML, while all PHP code remains hidden. If you take any HTML file and rename it to *.php, the HTML will be executed as if you were using *.htm or *.html. If you're coding in PHP, always use *.php files.

A web designer is ready to take a big step forward and learn PHP

A web designer is ready to take a big step forward and learn PHP

The first version of PHP was officially named Personal Home Page Tools; PHP Tools. It was simply the first use of the name PHP. Consider that the creator of PHP didn't initially intend for PHP to become a programming language. In the second version, Rasmus Ledorf claimed that PHP was the simplest and fastest tool for creating dynamic web pages. The third version of PHP completely changed the entire foundation from scratch. From all 4.x versions; the Zend Engine was added; which added a more advanced tag-parsing system - parse-execute, superglobals were introduced, register_globals was disabled by default, and CLI was introduced as an addition to CGI. Only from July 13, 2004, did the PHP version bring significant improvements, of which object-oriented programming support is definitely one. This opened up a whole new set of possibilities and a whole range of frameworks for PHP emerged; which we would translate as work frameworks like Laravel.

You see, the problem with PHP is that it's too simple. You can easily try out your ideas and admire the quick successful results. The problem is when your project gets bigger and your team gets more people. In PHP, you can do many things in multiple ways; what is simple for you can be completely complicated for others. Some things become obsolete, some are discarded, others change while each new phase becomes a nightmare. What is done in one day quickly turns into five days or you get completely stuck. For example, instead of the PHP header <?php, you type <php? and the entire project, the Internet, time, and deadlines will turn upside down. And you simply have no idea what's wrong with the errors. In the PHP programming language, there are so many mistakes; on some small details or logic that fixing errors can become a nightmare for every programmer.

And if you're entangled in classes, inheritance, interfaces, some project organization that only the first creator understands; documentation is useless then. That's why frameworks were created, and sometimes it's advisable to use them so that some things are organized for you. Again, if you're going to use shared hosting; then stick with pure PHP; because providers can disable e.g., routing on their server and then You're stuck or rent your own server, which will cost you three times as much. So, only experience saves you. And it's based on the mistakes you've gone through yourself; justified or not.

Preparing For the PHP Adventure: Setting Up Your PHP Programming Environment

Saturday, April 20, 2024

Ubuntu, the Best Linux Distribution, Why does It Stand Out from the Rest?

Definitely, you won’t go wrong if we tell you that Ubuntu is the best choice for a Linux distribution, especially if you’re a beginner in the Linux world, a programmer, or simply intend to install a variety of software and database systems and have them all work seamlessly. Despite the fact that distributions like Arch Linux follow the philosophy of KISS - Keep It Simple, Stupid – emphasizing simplicity – and may be more aligned with personal preferences, they require a deeper understanding of Linux and are better suited for experienced users. On the other hand, Ubuntu holds a special place in the world of operating systems due to its exceptional combination of reliability, user-friendliness, a rich Ubuntu Linux community, and a wide range of features it offers to users.

For instance, if you get employed by a company that uses a Linux operating system, there’s a high probability that you’ll be working with Ubuntu. The name Ubuntu, which translates to “Humanity towards others,” originates from South Africa. Although the creator and developer of the Ubuntu operating system, Canonical Ltd., is based in London, UK, with over 500 employees, Ubuntu consistently ranks at the top of many distribution lists and is even considered one of the best operating systems worldwide. Since its initial release on October 20, 2004, Ubuntu has become synonymous with stability, security, and innovation in the world of free software.

However, like many other distributions, Ubuntu has occasionally faced issues such as freezing during updates or power outages, requiring reinstallation and potentially resulting in data loss. From our personal experience in recent years, we don’t recall any major complications with Ubuntu that it didn’t resolve on its own, preserving my projects. Undoubtedly, Ubuntu has evolved significantly over these 20 years, maintaining its distinctive purple-orange aesthetics while providing an intuitive user interface

Ubuntu

Ubuntu, the best Linux distro

In terms of desktop environments, the Ubuntu distribution switched from its specific Unity desktop environment to GNOME after Ubuntu version 17.10. However, this can be changed by installing a different desktop environment using simple commands in the terminal. If you’d prefer to use another desktop environment, consider Ubuntu derivatives – Linux distributions based on Ubuntu. Some examples include Linux Mint, elementaryOS, Kubuntu, Lubuntu, Xubuntu, Ubuntu MATE, Ubuntu Studio, and Ubuntu Budgie. You can explore the Top 50 Linux distributions for 2024 here.

Ubuntu Linux is also a derivative itself. It is based on the Debian distribution and prioritizes ease of use, freedom from restrictions, regular release cycles, and straightforward installation. Ubuntu can be used in more than 55 languages. Its primary license is the GNU GPL - General Public License, but it also utilizes other licenses. The Ubuntu kernel, the core of the operating system; is monolithic, meaning the entire OS runs within the kernel space.

What further contributes to Ubuntu’s popularity among Linux users is its package manager, dpkg (APT), which it inherited from Debian. Many other distributions also use dpkg. However, it’s essential to note that Debian and Ubuntu dpkg packages are not always directly compatible with each other. Sometimes, *.deb packages created by Debian need to be rebuilt to work correctly in Ubuntu. For comparison, the Arch Linux distribution uses the renowned pacman package manager, which is quite different and is primarily used in Arch-based Linux distributions. Ubuntu also employs other tools like GNOME Software, Snap, Snap Store, and Ubuntu Software, making application installation easier, especially for Linux beginners.

Installing Ubuntu: A Comprehensive Guide for Beginners

Saturday, February 18, 2023

Pokrenite svoje putovanje veb razvoja, uvod u Laravel radni okvir

Ukoliko učite PHP programski jezik, čiji tutorijal možete pogledati ovde; možete se pitati šta je to Laravel i zašto bi ste i to učili. Zar PHP programski jezik nije dovoljan da iskodirate kakav god hoćete veb sajt, pa ukoliko je neophodno ako zatreba možete ubaciti i JavaScript i Ajax. Pa, vidite ovako; Laravel je open-source framework; na Srpskom jeziku radni okvir; za PHP programski jezik. On vam pomaže tako što preuzima odgovornost umesto vas za veliki deo poslovne logike vaših aplikacija, za mnoge uobičajene komponente kao što su validacija unosa, pristup bazi podataka, autentifikacija korisnika, izrada šablona itd. Danas programeri koriste mnogobrojne radne okvire za razvoj aplikacija, veb sajtova, biblioteke i komponente koje su drugi programeri iskodirali i testirali da vi to ne morate isto kodirati. Radni okviri održavaju konzistentnost i fleksibilnost i dok vi razmišljate, gde i kako nešto iskodirati u PHP programskom jeziku u vašem projektu koji postaje sve veći i kompleksniji; radni okvir razmatra samo: "Koju komponentu treba da koristim ovde?" Ako se pitate zašto baš Laravel; onda je moj odgovor zato što je trenutno jedan od najboljih za PHP developere. Ako se vratimo u prošlost; jedan od prvih radnih okvira je bio 2004 godine Ruby on Rails. Brzo je postao popularan jer je takođe popularizovao MVC, konvenciju nad konfiguracijom i mnoge alatke koje su doprinosile programerima brz razvoj aplikacija. Zatim se pojavio CakePHP 2005 godine i onda se razvoj nastavio u vidu CodeIgniter, Simfony, Kohana, Zend Framework itd. Još, 2010 godine CodeIgniter je postao veoma popularan radni okvir za PHP programere ali je kasnije počeo da zaostaje u tehnološkom razvoju i postao je previše spor. Zato je u junu 2011 godine, Taylor Otwella ponudio svoj radni okvir; napredniju alternativu CodeIgniter-a koju danas zovemo Laravel 


( Laravel je trenutno jedan od najboljih radni okvira za PHP programere )

Laravel 1 je doneo autentifikaciju, lokalizaciju, modele, views, sesije i rutiranje. Sve je iskodirano od nule. Laravel 2 je bio zaslužan za kontrolore, IoC i Blade. Laravel 3 je doneo Artisan i Bundles. Laravel 4 je otišao još dalje sa distribucijom paketa preko Composer radnog okvira. Zato se i kaže da je Laravel baziran na PHP programskom jeziku ali i na drugom radnom okviru Composer-u. Laravel 4 je još 2013 godine doneo još mnogo divnih stvari koje PHP programerima olakšavaju posao poput database seeding, automatsko upravljanje sa konekcijama baza podataka, 2014-te upravljanje PHP Cloud serverima, Vargrant okruženje, upravljanje pretplatama itd. Laravel 5 je još 2015 godine doneo novu strukturu direktorijuma i keširanje ruta itd. Od prekjuče; tačnije 16 februara 2023 godineLaravel je izbacio 10.2 stabilnu verziju koji zahteva minimum PHP 8.1 verziju. Svake godine se u prvih 6 meseci u SAD-u održava konferencija Laracon dok se ista održava u Evropi; tačnije Amsterdam-u u drugoj polovini godine; gde možete uvek saznati skoro sve o razvoju Laravel radnog okvira. E sad se možete pitati, ako je Laravel toliko dobar radni okvir zašto ga svi ne koriste? Mislim da postoje više razloga. Promene se često dešavaju u različitim verzijama, komponentama, kodu i postoje neke knjige i odlična dokumentacija o Laravel-u ali ponekad je komplikovano sve to uklopiti i ispratiti. Ukoliko koristite Share Hosting kod nekog provajdera; možda on jednostavno neće raditi. Druga stvar je ako vi zakupite vaš server. Tad možete da kontrolišete i da instalirate svašta na vaš hosting. Možete kompletan projekat da održavate i menjate kad se nešto promeni. Ali to zahteva mnogo više učenja i strašno je kad nad nekom komponentom nemate kontrolu. Zbog toga neki stariji iskusniji PHP programeri se drže čistog PHP  programskog jezika bez bilo čega što to može narušiti. Sve u svemu, što se mene tiče u svemu trebate biti fleksibilni; potrebno vam je vreme i mnoge greške da bi ste bili iskusniji u PHP  kodiranju ali jednostavno nema odustajanja. Uvek napredujete i učite. Još pre par meseci nije bilo šanse da instaliram Laravel na noviju verziju Linux distribucije Ubuntu-a zbog grešaka koje nisam razumeo dok je to danas druga priča.

Kako da instaliram Laravel?