[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:misc:approach_to_web_development_on_slackware [2020/11/21 20:15 (UTC)] – [Web Dev primarily HTML and PHP] captain_sensiblehowtos:misc:approach_to_web_development_on_slackware [2020/12/01 16:54 (UTC)] (current) – [Structure of HTML & PHP] captain_sensible
Line 7: Line 7:
  
 There will be some embedded information on HTML and PHP, what they do and what they do not do. I will probably throw in some anecdotal  info from my experience. There will be some embedded information on HTML and PHP, what they do and what they do not do. I will probably throw in some anecdotal  info from my experience.
 +
 +==== Structure of HTML & PHP ====
  
      
Line 35: Line 37:
  
 There are many alternatives to working with HTML documents using a text editor, but as good as any in my opinion is geany available from [[slackbuilds.org]].It has basic text highlighting and gets the job done. There are many alternatives to working with HTML documents using a text editor, but as good as any in my opinion is geany available from [[slackbuilds.org]].It has basic text highlighting and gets the job done.
 +
 +
 +==== Using Built in PHP dev Server to render HTML ====
 +
 +
  
 Now, if we were working with geany and saved the above text as a file say  index.html to your  Desktop, you then  have two choices; open and edit with a text editor or open it as intended with a web browser. If you do that, all you will see is "hello world" Now, if we were working with geany and saved the above text as a file say  index.html to your  Desktop, you then  have two choices; open and edit with a text editor or open it as intended with a web browser. If you do that, all you will see is "hello world"
Line 125: Line 132:
  
 Click on the line that says //about_me// and you will see that the HTML document about_me.html is now rendered. You now have the basis for a few pages on your web site. Some will pooh-pooh this, but it's better than the option of no web site, if you are a small business. Without a web site in today's world, you can't be found. Click on the line that says //about_me// and you will see that the HTML document about_me.html is now rendered. You now have the basis for a few pages on your web site. Some will pooh-pooh this, but it's better than the option of no web site, if you are a small business. Without a web site in today's world, you can't be found.
 +
 +
 +==== Making use of HTML presentation but with PHP functionality ====
  
  
Line 160: Line 170:
 Refresh your browser and now what do you see? Quite a lot of information concerning PHP! Refresh your browser and now what do you see? Quite a lot of information concerning PHP!
 When I first did this it demonstrated the potential of PHP.  When I first did this it demonstrated the potential of PHP. 
 +
 +==== Introducing Databases into the mix  ====
 +
 +
 Next we will have a simple look at using a database.When you mention anything about databases most people immediately think MySQl or Maria;so you can't do anything with a database on your Desktop since you need a daemon. Well actually you can since sqlite3 is server-less. Next we will have a simple look at using a database.When you mention anything about databases most people immediately think MySQl or Maria;so you can't do anything with a database on your Desktop since you need a daemon. Well actually you can since sqlite3 is server-less.
 Assuming our Terminal Emulator is in webPlay lets create a database from the command line. Actually lets first check we have the tools in place: Assuming our Terminal Emulator is in webPlay lets create a database from the command line. Actually lets first check we have the tools in place:
Line 251: Line 265:
 which is another approach for working with web development.  which is another approach for working with web development. 
  
 +
 +==== PHP framework ====
  
 Before we look at xampp and apache i'm going to mention composer [[https://getcomposer.org/|composer ]] Before we look at xampp and apache i'm going to mention composer [[https://getcomposer.org/|composer ]]
Line 275: Line 291:
 </code>In the above,the first word "composer"  composer invokes the binary; "codeigniter4/appstarter" is a key pair of words that you will see on [[https://packagist.org/|Packagist]]  and CI4 is the name  i want of the directory to be called which will contain CodeIgniter. This is the structure i get after issuing the command: </code>In the above,the first word "composer"  composer invokes the binary; "codeigniter4/appstarter" is a key pair of words that you will see on [[https://packagist.org/|Packagist]]  and CI4 is the name  i want of the directory to be called which will contain CodeIgniter. This is the structure i get after issuing the command:
  
 +<code>
 CI4 CI4
 ├── README.md ├── README.md
Line 314: Line 330:
  
 There are pro's and cons. Its doesn't use your system PHP as far as i understand it, so your own PHP might be more up to date than xampp, then there are issues like updating. From my limited understanding a web server does not come as default with other distros, so for them they have the choice: should I install apache or give xampp a go, maybe thinking at least I won't bork my system- its quite understandable. There are pro's and cons. Its doesn't use your system PHP as far as i understand it, so your own PHP might be more up to date than xampp, then there are issues like updating. From my limited understanding a web server does not come as default with other distros, so for them they have the choice: should I install apache or give xampp a go, maybe thinking at least I won't bork my system- its quite understandable.
 +
 +
 +==== Setting up a Development Environment using Apache ====
  
  
Line 335: Line 354:
 # mv CI4.zip /var/www/htdocs  # mv CI4.zip /var/www/htdocs 
 </code> </code>
 +
 +===  Approach To permission problems ===
  
  
Line 408: Line 429:
 secrets when I show you my local WP ;it looks like this: secrets when I show you my local WP ;it looks like this:
  
-{{:howtos:misc:wp_users.jpg?600|}}+{{:howtos:misc:wp_users.png?600|}}
  
 Its an extract of how WP uses Sqlite (yes you can opt for sqlite  instead with WP)   WordPress seems to be poorly written and a word of warning; in a default install its possible to display user login credentials via a simple get request to the domain!So the security of connecting to a database adds nothing to the security of your user credentials with WP Its an extract of how WP uses Sqlite (yes you can opt for sqlite  instead with WP)   WordPress seems to be poorly written and a word of warning; in a default install its possible to display user login credentials via a simple get request to the domain!So the security of connecting to a database adds nothing to the security of your user credentials with WP
Line 484: Line 505:
  
 Note the 127.0.0.9 in address bar and that I can now work with framework and edit as user andrew , without risk of messing up system as root. If you follow this through and you get a problem its probably either your php version is < than 7.3 or I did something somewhere forgot about it and  forgot to mention . Note the 127.0.0.9 in address bar and that I can now work with framework and edit as user andrew , without risk of messing up system as root. If you follow this through and you get a problem its probably either your php version is < than 7.3 or I did something somewhere forgot about it and  forgot to mention .
 +
 +
 +
  
  
 ====== Sources ====== ====== Sources ======
 +
 +
 <!-- If you are copying information from another source, then specify that source --> <!-- If you are copying information from another source, then specify that source -->
 <!-- * Original source: [[http://some.website.org/some/page.html]] -of -> <!-- * Original source: [[http://some.website.org/some/page.html]] -of ->
 <!-- Authors are allowed to give credit to themselves! --> <!-- Authors are allowed to give credit to themselves! -->
-<!-- * Originally written by [[wiki:user:xxx User X]] -->+ Originally written by [[wiki:user:captain_sensible  captain_sensible]] 
 <!-- * Contributions by [[wiki:user:yyy | User Y]] --> <!-- * Contributions by [[wiki:user:yyy | User Y]] -->
  
 howtos:misc:approach_to_web_development_on_slackware ()