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´s done and online 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 Yesterday, the 7th. of august 2023, I installed OSSN-social media application and added the facebook-theme to it. This theme looks 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 think it's awesome: finally we can have social contact again like it's supposed to be: for the users instead of the owners(´ bankaccounts). No selling personal data, no unclear rules, no censoring, no crap that nobody wants in the first place, just a safe and happy social environment .

Hello people: friends, family and the world!

I have started this blog to write about my main hobby: webpage-design with which I communicate about all my other hobby's. So I make websites about my hobby's and I make websites about my life and that's how I express myself online. I feel that webdesign is a type of art and that my websites are pieces of art about the things that I like. So why do I have a blog on blogspot and not on my own domain exdomo.com if making websites is such a hobby of me? The answer is pretty simple, just as simple as it is to have a blog on blogspot: I want to invest my time on creating pieces of webart and I need enough webspace for that. Running a blog on my own domain will take up quite some diskspace because of the database that needs to be connected with it and because I do not have much financial resources I want to spend my money well and that is making websites. Next to that: I have accounts on several Social Media like Facebook, Twitter, Reddit, Quora and some more, but they all do n

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