Day 1
x--------x
PUSHING AND UPDATE TO REPO ONCE SAVED:
1. git status
2. git add (filename) or git add . (for all files)
3. git commit -m "short message goes here"
4. git push
5. git push --set-upstream origin [branch-name] (only if its the first time pushing or you set up a new branch)
x--------x
Day 1
Project Goal:
By EOD, create and host a domain, upload work log text, do some light color and formatting if possible, include a funny header image (bingus?), create a MySQL database, fill with 10 lines of data(?)
Tidbits:
1) discovered php-gtk, a non-native extension that allows for desktop applications with GUIs
2) "Each time a PHP page is requested, the web server starts up the PHP interpreter as a separate process to handle the request. This approach is more flexible because it allows PHP to be used with any web server that supports the CGI protocol."
- more flexible when using different web servers (CGI)
- more secure (CGI)
- faster (module)
- custom php configs on a per-domain or per-script basis (CGI). An example of this is being able to adjust memory_limit or upload_max_filesize on different sites on the same server without affecting the others
- can overcome module limitations, again, as far as security is concerned (CGI)
- better debugging and monitoring since each php request is handled by a separate process--you can track and analyze individual executions (CGI)
- finer control over cpu & memory usage per script or per user (CGI)
- lower resource consumption, faster response times (PHP)
3) "Modern implementations like PHP-FPM (FastCGI Process Manager) aim to offer the best of both worlds, providing the performance benefits of module-based setups with the flexibility and security advantages of CGI."
4) "So with PHP, you have the freedom of choosing an operating system and a web server. Furthermore, you also have the choice of using procedural programming or object-oriented programming (OOP), or a mixture of them both."
5) "PHP-FPM (FastCGI Process Manager) is an advanced and highly efficient implementation of PHP FastCGI, designed to handle heavy loads of requests robustly and with a minimal overhead. It's a significant improvement over both the traditional CGI-based approach and the module-based approach, offering several advantages that combine the best aspects of both."
6) "Protocols are standardized rules that define how data is transmitted and received over a network, ensuring that different systems can communicate with each other effectively. These rules include the format of data messages, the way to initiate and terminate a communication session, and the procedures for managing data transmission errors.
7) "Create a Database: First, you need a database. This involves using MySQL commands or a database management tool like phpMyAdmin to create a database and define its structure, including tables, columns, and data types. Insert some data into your database tables that you will later retrieve and display through your PHP script."
8) Security & Best Practices:
- SQL Injection Prevention: When creating database-enabled web pages, it's crucial to protect against SQL injection attacks. This can be achieved by using prepared statements and parameterized queries.
- Database Connection Security: Keep your database connection details secure by storing them outside of the web root and using environment variables or configuration files that are properly protected.
- Data Validation and Sanitization: Always validate and sanitize data received from users before using it in your application or database queries.
9: Committing to Git from Git Bash terminal
- Add Files to the Staging Area: The git add command adds your project's files to the staging area, making them ready to be committed. To do this, use: 'git add .'
- Committing changes: Commit your added changes to the repository. The '-m' flag allows you to add a commit message inline. To do this, use: 'git commit -m'
- Push Your Code to the Remote Repository: Use the git push command to push your commits to the remote server. The -u flag sets the upstream reference for future commands. To do this, use: 'git push -u origin master'
- Working on Your Project: As you make changes to your project, regularly commit those changes to track your progress. Use git status to see which changes are staged, unstaged, or untracked. To do this, use: 'git status'
- Add and Commit Changes: Repeat the git add and git commit process for your new changes, providing meaningful commit messages that describe what was done. To do these, use: 'git add' and 'git commit'
- .gitignore File: Create a '.gitignore' file in your project root to specify intentionally untracked files that Git should ignore. Examples include dependency folders like node_modules, build directories, or environment configuration files.
- Branching: Learn about branching with git branch and git checkout commands. Branches allow you to work on different features or fixes without affecting the main codebase.
Work Log:
- downloaded xaamp
- started local server
- created JudsonsClocks website folder
- created worklogs folder [will create a website that features all of my worklogs]
- reading php documentation
- learning about PHP running as a module (M) or the CGI protocol
- learning about protocols and what they are / do in general, as well as specifically in the case of PHP
- gathering context information about setting up a database and maintaining/creating simple layers of security
- purchasing domain
- navigating namecheap, dns settings, cpanel, trying to set up mysql database
- filing a support ticket with namecheap because i signed up with the wrong email
- got into cPanel, selected hosting plan and provider, site is live
- added judsonsclocks mySQL database
- created database user and granted all privileges
- installing Git
- querying gpt for info on git (hw)
- familiarizing myself with git commands
- learning about .gitignore
- attempting / debugging attempt to add and commit .gitignore file
- finalized git setup and pushed branch to the remote repo
- success: judsonsclocks.git is active, private, and has single .gitignore file
- troubleshooting issue with the site not loading
- discovered issue tracing back to email problem
- changed account email under domain list management tab, verified account, now will wait 24-48 hours for site to go live and can work on localhost side in the meantime
- using gpt to generate a sample/test index.php file so that I can test it on the localhost site version
- pushed index.php to git, somehow showed up on my localhost server site?
- diagnosing to find the crossup
- discovered that the index.php file wasn't in the xampp htdocs folder, but instead in the github repo
- cut from desktop, pasted into xampp htdocs folder, restarted apache and MySQL
- trying to get git to push stuff
- since i moved the folder into xammpt htdocs, i need to set a new repo
- vscode isn't recognizing php executable
- debugging
- installing php extensions for vscode
- discovered the issue which was that vscode was still saving to the judsonsclocks on my desktop and not the xampp/htdocs folder
- messing with directories and folders, learning how to store different files and where they are supposed to go
- tinkering with pushing a git adjustment to git after ensuring functionality on localhost server: gif of bingus the cat on homepage for comedic value
- nofuckingwayitworked.jpg
- edited text, tried committing without a message, gitbash didn't like it, stuck on commit message screen // debugging
- had to force quit
- learning how to upload files
- need to compress files before uploading to cPanel file manager (doesn't allow folders. only zips or individual files)
- created directory inside of main xampp folder that is called htdocs compressed packages--will contain each live push to the site, thankfully won't need to do this too often
- extracting first live push
- running into issues with the domain pointing in the wrong directory
- moving folders out of that directory and under public_html
- all discombobulated, deleting and re-extracting
- fixed!