Doorgaan naar hoofdcontent

Install PHP locally

PHP the easy way

If you have a website with PHP-files, you can install a webserver-package with PHP, Apache webserver and MySQL for example, one like Xampp, Wampserver or whatever. But that can bring some serious trouble too: often you need to change several settings and other additional software to make everything work and it can therefore become pretty annoying.
But what if you only need PHP? Is there a simpler way to maintain your website offline?

Yes there is, let me explain: you can go to the downloadpage of php.net or if you are on windows even easier: go to the windows-downloadpage.

Preparing for installation

Download the PHP-version you want (look for the version you´re running on your website) and extract the package to any folder you want.

In the root folder where you unpacked the zipfile exists a file called "php.exe". Starting this file alone is not going to work, you need to give it some extra info.

Getting it done

Now, I have unpacked the downloaded file to my external harddrive called D in the folder "progs" and my website exists also on my external harddisk D in the folder "D:\Documents\Hobby\Internet\Websites\exdomo".

I opened my text-editor and typed the following text to make a batchfile (the second line starting with D: and ending with exdomo should not have line-breaks)

@echo off
D:\progs\php\php.exe -S localhost:8080 -t D:\Documents\Hobby\Internet\Websites\exdomo
pause

Then I saved this file on my harddisk with the name: server.bat
Note: slashes need to be backslashes in your batchfile).

To this file I added a shortcut on my desktop.

Now when I click the shortcut the start-up screen appears and when I open my webbrowser and type in the adress bar: "localhost:8080" I see the website offline.

Exit php using ctrl-c and answering the question with "Y"

Reacties

Populaire posts van deze blog

New website online! (and more)

Take me straight to the webpage! Hard work It was a lot of work re-designing my websites, but finally it was done and online end 2023. But either the blog or the social-media section got hacked (I could have known) so I took those down, never again any interactivity on my website (this is the second time in 23 years this happened). Website-architecture All the websites now have the same architecture, this means that whenever I need to make changes in the future again, it will be a piece of cake. Social-media section The 7th. of august 2023, I installed OSSN-social media application and added the facebook-theme to it. This theme looked exactly like facebook did in the old days, before they started adding all kinds of things that nobody asks for and that make facebook a labyrinth in which nobody can find anything anymore. I thought it was awesome: finally we could have social contact again like it's supposed to be. No selling personal data, no unclear rules, no censor...

Goodbye to Fb

Out of control Hacked accounts, scammers, trolls, lack of communication, unclear community rules, dozens of glitches and almost daily new changes that nobody knows of: Facebook has become a misty swamp filled with predators and mosquitos I am getting out of it before I get lost in this labyrinth run by greedy false prophets. The beast from the earth Here is wisdom. Let him that hath understanding count the number of the beast: for it is the number of a man; and his number is Six hundred threescore and six. And that's it, the worshipping of the beast, but it's time has come, greed is not sustainable but selfdestructive and this beast has entered the final phase. Back to basics A lovely wife, a beautiful farm, the serenity of mother earth around us: those are the basic ingedients of happiness I am not going to participate in this worshipping of the beast anymore, as soon as my account gets restored, I am deleting it

De codex Hammurabi

Breng me direct naar de webpagina! Hammurabi´s wetten Één van mijn eerste website-projecten was het vertalen van de wetboeken van Hammurabi Bronnen Ik heb deze vertaling niet vanuit het Babylonisch gedaan maar een Engelse en een Duitse vertaling gebruikt En dat was al werk genoeg.... Rechtvaardig Hammurabi was een hardvochtig man (moest ook wel in die tijd) Maar hij was óók rechtvaardig: hij heeft bijvoorbeeld diverse wetten geschreven over het vals beschuldigen van een ander