Cpanel - JWalshe86/nags-with-notions4 GitHub Wiki

Serving On Cpanel

To zip NWN4 & not include anything ending with .git

zip -r nags-with-notions4.zip nags-with-notions4 -x '*.git*'

Cpanel

  • Click on public_html
  • Select & delete all content
  • Upload zip file
  • Open NWN4 folder
  • Select all & move to public_html image

Go to NWN

Cpanel Tools Terminal & Git

This is the response re getting a terminal image

Response re getting git version control image

Adding SSL

Following this Need to get a SSL cert first. Going to use this Web Host Tutorials vid Using zerossl.com Using this medium article to verify through HTTP file upload.

🎉 image

🎉 image image image

Moving php/mysql to cpanel

image

image password =

Sunshine7!!

Database passed over to phpmyadmin image

Changes to cpanel conn_db.php

<?php  

$sname = "localhost";
$uname = "root";
$password = "Sunshine7!!";

$db_name = "ol5wws00_image_db";

$conn = mysqli_connect($sname, $uname, $password, $db_name);

if (!$conn) {
	echo "Connection failed!";
	exit();
}

password for root changed to = Sunshine7!

image

Error no longer present for users.php image

view.php showing image

🎉 Images upload on cpanel image

CRUD Working on authorisation 🎉 image

🐛 Cpanel rendering upload.php on main page instead of index.html image

Looks like I'll have to do something like this: Moving site from root

Creating a .htaccess file

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?$domain.tld$
RewriteCond %{REQUEST_URI} !^/$newfolder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /$newfolder/$1
RewriteCond %{HTTP_HOST} ^(www.)?$domain.tld$
RewriteRule ^(/)?$ $newfolder/index.php [L] 
</IfModule>

🎉 image

Using this I could access the xampp version of mysql

cd /opt/lampp
./mysql -u root -p

password is Sunshine7!!

cpanel works again with this - when change password have to re-assign user to db again

<?php
    class crud{
        public static function conect()
        {
           try {
		   $con=new PDO('mysql:localhost=host; dbname=ol5wws00_crudsystem2','ol5wws00_root','Sunshine7!!');
		   return $con;
           } catch (PDOException $error1) {
                echo 'Something went wrong, with you conection!'.$error1->getMessage();
           }catch (Exception $error2){
                 echo 'Generic error!'.$error2->getMessage();
           }
        }
	public static function Selectdata()
	{
	    $data=array();
            $p=crud::conect()->prepare('SELECT * FROM crudtable');	
	    $p->execute();
	    $data=$p->fetchAll(PDO::FETCH_ASSOC);
	    return $data;
	}
	public static function delete($id)
	{
	    $p=crud::conect()->prepare('DELETE FROM crudtable WHERE id=:id');
	    $p->bindValue(':id',$id);
	    $p->execute();
	
	}
        public static function userDataPerId($id)
{
    $data=array();
    $p=crud::conect()->prepare('SELECT * FROM crudtable WHERE id=:id');
    $p->bindValue(':id',$id);
    $p->execute();
   $data=$p->fetch(PDO::FETCH_ASSOC);
   return $data;
}

    }

Moved images table to crudsystem2 db image

⚠️ **GitHub.com Fallback** ⚠️