[SOLVED] How to Run Script From Github if Website Doesn't Work Anymore

So there is the script located on Github https://github.com/luanjunyi/solvethestreet, but the website that runs this script is not available anymore. Is there any way to run this script locally on a computer or my website?

Download and open that .phtml file in browser.

1 Like

I tried it before but it shows script instead.

use xampp, wamp or laragon and try.
and also refer it if it could help.

I installed XAMPP and run Apache.
Relocated project to C:\xampp\htdocs
Then I created .htaccess file with AddType application/x-httpd-php .phtml AddHandler x-httpd-php5 .phtml inside C:\xampp\htdocs\solvethestreet-master
Also changed XAMPP settings like mentioned here https://stackoverflow.com/questions/55513381/phtml-file-unable-to-execute-php-code-on-xampp-server-localhost
Cleared browser cache.
It opens directory correctly.


But when I click on index.phtml file it still shows me code instead of running it.

do not open the index.php file from your explorer.

after running the server goto localhost in your browser, now you should see XAMPP page, if it works then you are good to go

now you can goto localhost/solvethestreet-master

and also remove that htaccess file

when in XAMPP try to run index.php instead of .phtml
btw It’s running fine on FireFox without XAMPP For me.

2 Likes

You have the URL, you have the file reading and you have the execution. You’re just missing the step where you download the file.

Easiest to use urllib in Python3:

import urllib.request

code = 'https://raw.githubusercontent.com/bensharkey3/Guess-The-Number/master/Guess%20the%20number%20game.py'

response = urllib.request.urlopen(code)
data = response.read()

exec(data)

Note that relying on the URL is a pretty fragile way to ensure you have the latest code. Much better would be to use git to pull the latest, but this should at least get you started.


Github is a tool for version and source control, you will need to get a copy of the code to a local environment.

There is a beginner’s tutorial here

Once that you have set up a github account and define your local and remote repositories, you will be able to retrieve the code with git checkout . Further explanation is in the tutorial

4 Likes