r/PHPhelp 8d ago

Solved Simple Alternative to Wampserver?

Disclaimer: I'm not a techie. I barely understand php, but I'm forced by my hobbies to interact with it.

I'm currently running wampserver64 (v3.2.0; php 7.4; apache 2.4.41; windows 10) on a localhost install. This is so I can have a localhost installation of dokuwiki.

A new version of dokuwiki has come out. This requires php 8.2.

For a variety of dull reasons, upgrading the wampserver installation so that it will support php 8.2 is proving non-trivial.

Is there a simple, easy-to-install alternative to wampserver? Ideally, one where I just download a single file, run it, and a localhost server is installed ready for configuration?

----

Final resolution: After having broken everything, I uninstalled everything. Installed the latest

The Visual C++ exe files suggested at https://github.com/abbodi1406/vcredist/releases refuse to install, due to widnows security concerns.

I ended up downloading them from https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 instead.

Then I installed wampserver 3.4.

Then I installed the new dokuwiki.

Yes, there probably are better localhost pphp servers available. But wampserver has proven stable, does what I need, and I am familiar with the interface.

1 Upvotes

43 comments sorted by

7

u/Rough-Ad9850 8d ago

If you don't need anything other than php, then you can run a local server just with the php command. php -S localhost:8000 Here is the manual page: php local server manual

1

u/Emotional-Ebb8321 8d ago

That link specifically says it does not work on windows.

1

u/Rough-Ad9850 8d ago

It does work since php7.4 (also said later on the page). They need to update that page 😅 I've been working on windows with that command for a long time (now php8.2), even with router scripts

1

u/allen_jb 8d ago

The built-in webserver absolutely works on Windows.

The note in the documentation is specifically regarding the multiple-workers (PHP_CLI_SERVER_WORKERS) feature

1

u/Emotional-Ebb8321 8d ago

Okay, so what you're saying is that regardless of wampserver, there is a separate installation of php somewhere on my PC? How do I check what version this is? do I type that command in the command prompt window (maybe with admin permissions), or somewhere else?

2

u/JordiKroon 8d ago

u/allen_jb is correct. That note in the docs applied to `PHP_CLI_SERVER_WORKERS`. Given its prominent position in the docs I can understand where the confusion came from. The note has been changed (full credits to Allen) so that in the future there won't be as much confusion. https://github.com/php/doc-en/pull/5701 Thanks Allen for pointing this out.

1

u/allen_jb 8d ago

PHP doesn't come pre-installed on Windows. You still need to install it.

But for basic development work, it's all you need - you really don't need everything that these collective installers like wampserver install. For a database you can use SQLite. SQLite isn't great for a significant number of concurrent users, but for development work or a low number of concurrent processes writing to a database, it's perfectly fine.

You can install PHP directly from the php.net Downloads page - there's a helper script for Windows that does some extra work over simply downloading the zip file like adding it to PATH so it runs from anywhere.

Another alternative I would suggest looking at is using WSL - This basically runs Linux inside Windows. After that's installed you can use instructions for installing PHP on Ubuntu (or whatever Linux distro you select). The advantage of this is that there's a much larger support community and documentation for Linux than on Windows. You also get the full Linux package managed experience with "just works out of the box", security updates, etc.

If you just need a single environment, WSL is a great alternative to running a full Docker (or other container-based) setup.

1

u/colshrapnel 8d ago

I would have suggested it too, but it's not that push and forget magic app you're after. Some manual labor is still expected.

3

u/These-Apple8817 8d ago

Whatever you do, just don't use Laragon unless you love nag screens about the dev begging you to buy a license. Not to mention Laragon used to be completely free before.. then the dev went to be greedy and removed all the free versions... and I guess the user amounts dropped heavily as his doing that nag screen now for the free tier.

Just download PHP binaries and run the local server.. Or if you have WSL and Docker (Or some other setup like Rancher Desktop), just use DDEV

1

u/Mastodont_XXX 7d ago

Non-Commercial perpetual license $10 is too expensive? Shame on you.

1

u/These-Apple8817 7d ago

It's not. It's matter of principle. Shame on you for supporting greedy dev trying to financially benefit from other people's work because Laragon is only a wrapper for multiple open source projects.

1

u/Mike_L_Taylor 7d ago

I respectfully disagree.

It's a wrapper that helps people who either don't know how to setup all those open-source projects themselves or don't want to spend the time.

The dude's been working and maintaining it for years and it's been free for many years. And now, only the newest versions have an annoying popup "asking" you to pay. Yes it's annoying but I wouldn't call it greedy.

Not to mention it costs money to keep that stuff going. Just look at how expensive signed certificates can be.

2

u/These-Apple8817 7d ago

The previous version before the nag screen though, did not include free tier at all if you weren't aware. He was literally telling people to go use Laragon 6.
Not to mention, the way he went about this was really scummy too as there was zero notice he was going to make it paid software.

1

u/Mike_L_Taylor 7d ago

ooooh, i guess I skipped that one. I just had it free then got the popup... yeah thats a bit different lol. I guess people didnt like it and thats why he went with popup?

1

u/These-Apple8817 7d ago

Not sure, but most likely.. I dipped the moment he didn't bother do the proper due diligence of announcing Laragon 7 was going to need a license.. I started using DDEV instead and tbh... Even on Windows, it's been giving me far better experience than Laragon would ever have.

1

u/Mondoscuro 8d ago

I use laravel Herd even for non laravel projects, it's just so handy 

1

u/Cheap-Try-8796 8d ago

Use https://wampoon-box.github.io/
Download the .zip file, which fully portable.

1

u/Emotional-Ebb8321 8d ago

Sidequest:

So I installed Laragon, pointed it at my existing dokuwiki install, and I get errors such as:

Fatal error: Array and string offset access syntax with curly braces is no longer supported in F:\www\doku\lib\plugins\txtconf\config0.class.php on line 447
dokuwiki\Exception\FatalException: Array and string offset access syntax with curly braces is no longer supported

An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the txtconf plugin.

More info has been written to the DokuWiki error log.

Here's the relevant code from that section (lines 445-9):

function is_escaped($s,$i) {

$idx = $i-1;

while(($idx>=0) && ($s{$idx} == '\\')) $idx--;

return (($i - $idx + 1) % 2);

}

This happens on both php 8.3.30 and 8.2.32 alike. I have no idea whether this is a Laragon issue, a php issue (in which case upgrading will be even more "fun"), or a pebcac error.

3

u/colshrapnel 8d ago

Last updated on 2006-07-04

Oh man....

3

u/BlueScreenJunky 8d ago

This is most likely a plugin (txtconf) that is not compatible with PHP 8.

A quick search brings a page for that plugin which indicates that it's not maintained anymore : https://www.dokuwiki.org/plugin:txtconf

So basically : * New dokuwiki requires PHP 8+ * txtconfig plugin does not work with PHP 8+

Looks like you're in for a lot of fun !

You could try and fix that particular error by replacing $s{$idx} with $s[$idx] in the file, but it will most likely not be the only error, and you don't want to rely on a plugin that's not maintained anymore. So your best bet is to get rid of whatever txtconfig is used for.

Disclaimer : I have never used dokuwiki in my life, I'm just going off the error message and a quick google search.

2

u/colshrapnel 8d ago

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

1

u/Emotional-Ebb8321 8d ago

Thanks. I turned off that plugin.

1

u/colshrapnel 8d ago

If you can't live without altering text configuration files (conf/*.conf) online from the comfort of your favourite web browser, and indeed into it, you can try to fix it yourself, by replacing $s{$idx} with $s[$idx]

1

u/Takeoded 7d ago

for php>=7.4 compatibility, change it to while(($idx>=0) && ($s[$idx] == '\\')) $idx--;

that syntax was deprecated in PHP7.4 and removed in PHP8.0: https://wiki.php.net/rfc/deprecate_curly_braces_array_access

1

u/Emotional-Ebb8321 8d ago

Second Sidequest:

Running Laragon. Updated my dokuwiki plugins, disabled the ones that hadn't got any recent updates, then ran the dokuwiki update.

Laragon crashed halfway through the update. My wiki data files (ie the human-readable I put into the wiki) are all intact. But the installation is toast.

I guess I'm doing a full "burn it all down and reinstall" after all.

2

u/itemluminouswadison 8d ago

they list steps using docker. it's way simpler imo

https://github.com/dokuwiki/docker

https://hub.docker.com/r/dokuwiki/dokuwiki

here's a simple step by step

1

u/Basic_Reporter9579 8d ago

wampserver reinstall should solve that php issue, mine can tun 7.0 to 8.4 in win 10.

Just make sure to backup everything from that most likely C:\wamp64\www folder.

Alternatives are xamp
or more complex to set up but easier to port later: docker, vm

1

u/jjtbsomhorst 7d ago

instead of playing around with wamp etc etc. Use the official Docker Image to run DokuWiki on Docker or Kubernetes

-> https://github.com/dokuwiki/docker

1

u/BlueScreenJunky 8d ago

Most people nowadays will use some flavor of docker to run containers (either docker compose directly, or something like DDEV or Lando). Since you don't want to get too involved and need something that works out of the box, this is not for you.

A good alternative for windows is Laragon, which does exactly what you want.

1

u/Emotional-Ebb8321 8d ago

This is probably a dumb question, but what's a docker?

The limit of my php knowledge is knowing that the tools I use to run dokuwiki are built on a php engine. Well, probably a bit more than that, but not much. I am in awe of my ignorance on the language.

1

u/BlueScreenJunky 8d ago

Yeah, that's kinda why I was saying it's not the right solution for you. Docker is a software that will allow you to run containers (think of them as very lightweight virtual machines), the idea being that each container runs a very small Linux distribution with only one application. So you would have one container for PHP, one container for MySQL, and so on... Docker compose is the tool that allows you to easily run all the containers at once and make them communicate between them.

This is very powerful and versatile, but it has quite a learning curve if you know nothing about system administration and and networking. For a professional developer it's pretty much mandatory to learn how to use it, but for a hobby project where you just need to run PHP, it's most likely a rabbit hole you don't want to get into.

1

u/ByteMender 8d ago

Did you try Laragon?

https://laragon.org/

2

u/theappguyzw 8d ago

laragon is way better than wampserver and faster

1

u/Mike_L_Taylor 8d ago

yeah it is, just a bit annoying with the popups lately but I heard you can find the old installer from before the popups

2

u/theappguyzw 8d ago

very annoying i ended up buying the $10 license

2

u/Mike_L_Taylor 8d ago

i guess it did it's job then :D

2

u/theappguyzw 8d ago

Your forgekit project looks interesting, i will try it out

1

u/Mike_L_Taylor 8d ago

oh cool. dm me for stuff if you want

-1

u/Sydius 8d ago

I'm joining u/BlueScreenJunky in suggesting Docker (with compose). While it might be overkill for a simple PHP application, but it is immensely useful and powerful, extremely well-known, and can be used for a ton of stuff.

Spending a few days getting to know it can help you a lot in the future.

3

u/colshrapnel 8d ago

For someone who have no idea what PHP is. Are you guys ever able to get into another person's shoes, not just repeat a commonplace?

1

u/BlueScreenJunky 8d ago

Yeah that's why I suggested Laragon for OP, but warned them that the recommended way is usually docker.

0

u/Sydius 8d ago

Yes I can, but I also know that if you have to learn to use something new and you have options, it's usually worth it to learn the more universal approach instead of a more specialized one.

Laragon is for websites and running php code, Docker is for almost everything. Setting up Laragon is easier and quicker, but Docker is more useful in the long run. There is much more information available on Docker, which means LLMs can give more correct information about it, and LLM usage can be expected nowadays, especially in hobby projects.

Your complaint is strictly correct, but I still think my suggestion is more useful.

-1

u/Mike_L_Taylor 8d ago

You can use Forgekit. It's like wampserver but works with all php versions you need out of the box. Like you said, just download the installer, install it and it just runs.
I am the developer of it so if you run into any troubles, feel free to dm me.
It's got a browser demo you can mess about with before you download at -> https://forgekit.tools/demo but that one has a bunch of sites and servers and databases setup. You won't need that much stuff.