FAQ
General
How do you make a custom 404 error page in Joomla! 4?
/* Load Custom 404 article with true 404 error code returned */
if ($this->error->getCode() == '404') {
header("HTTP/1.0 404 Not Found");
echo file_get_contents(JURI::root().'/404');
exit;
}
What are the requirements to run Bearsampp?
Bearsampp is dedicated to 64 bit architecture.
Microsoft states that, “Beginning with Windows 10, version 2004, all new Windows 10 systems will be required to use 64-bit builds and Microsoft will no longer release 32-bit builds for OEM distribution.”
Further we use vs17, Thread safe, avx Achitecture(s). vs17 is built into our prerequisites package.
To find out if your system is compatible...
Open a terminal and type each of the three commands below and compare them to what is shown.
php -i | findstr CompilerCompiler => Visual C++ 2017
php -i | findstr ArchitectureArchitecture => x64
php -i | findstr ThreadThread Safety => enabled
Thread API => Windows Threads
Finally run cpuz and be sure you have avx support in your cpu.
What is the difference between the various versions of Bearsampp?
Module | Type | Full | Basic | Lite |
---|---|---|---|---|
Adminer | application | |||
Apache | binary | |||
Composer | tool | |||
ConsoleZ | tool | |||
Filezilla | binary | |||
Ghostscript | tool | |||
Git | tool | |||
Gitlist | application | |||
MailHog | binary | |||
MariaDB | binary | |||
Memcached | binary | |||
MySQL | binary | |||
ngrok | tool | |||
Node.js | binary | |||
Perl | tool | |||
PHP | binary | |||
phpMemAdmin | application | |||
phpMyAdmin | application | |||
phpPgAdmin | application | |||
PostgreSQL | binary | |||
Python | tool | |||
Ruby | tool | |||
Webgrind | application | |||
XDebugClient | tool | |||
Yarn | tool |
Where is the source code for Bearsampp?
Bearsampp is based on Aestan Tray menu 1.7.0.
Bearsampp uses the exe and the .ini file to generate the tray menu.
Everything is open source and housed on Github
Who is behind Bearsampp?
Hi, I'm Bear;
Bearsampp came as a fork of Neard, the developer stopped updating it in 2021 and many of us really liked the program and wanted it to continue, so I forked it and started working on updating it.
Along the way it was decided to give it a new name and remove code for ancient versions of windows and fix any bugs that we could.
To help prevent this from ever happening again I created a Github project for it so that anyway can take over when/if I'm gone.
By supporting me by either donating or contributing you help insure the longevity of this program.
Development
How do you use sandbox?
Sandbox is our in-house R&D system
While your welcome, and infact encouraged, to use it for development of the Bearsampp program is it NOT for use as your daily driver! It's strictly a R&D system.
There are a few things that are very unique to Sandbox and require important consideration.
ANY branch other then main should be considered alpha and highly likely to break everything. Using sandbox requires patience and understanding how things function.
I'll attempt to explain things but nothing will replace experience. Even Jacob and Bear have been slapped by sandbox more then once!
How to setup sandbox
Setting up sandbox is not difficult but the steps are exacting.
Using Sandbox is alot like any other repo in that you do a git clone and your on your way... EXCEPT there is a requirement that you do these steps in the following order.
- your expected to be familiar with how to use a git aware IDE. Your welcome to use the cli but these instructions are designed for an IDE.
- clone the branch "main" into your working directory
- switch to the branch "release"
- rename the branch "main" to anything
- using the "remote" branch feature merge the remote "main" branch on top of the local "release" branch
- rename the local "release" branch to "main"
- delete the branch you renamed main to
- you should now have a single local branch named "main" In this branch is a full working version of the "Sandbox" version of bearsampp including all unique iconography.
- start up Sandbox and test that everything works. If so you're ready to do R&D
Firing off a bombing run
Doing a bombing run is fun and scary at the same time. This is a large commitment of drive space so if your on anything smaller then a 64gb drive, and not at least usb 3.0 you should probably not do this!!!
So now that your worried, lets put our bomber jacket on and punch that pickle.
- This couldn't be simpler. Make sure your on the "main" branch.
- if this is a fresh install of Sandbox then remove all branches from your local except "main"
- go to the sandbox repo release for bomber payloads and download all the files there.
- use the extract.bat and unzip all the files
- put the bin in the root of sandbox and do NOT overwrite
Why bother with Sandbox?
Jacob and Bear had several "discussions" over the merits of sandbox. It was conceived and matured by Bear as a safe environment to test the numerous changes that were upcoming without endangering our "core".
Bear had nuked his installation of core that was his daily driver more then once and with dozens and dozens of fixes coming it was important that there was some simple way for things to be done.
You have to understand that when Bear thinks something is "simple' you should probably be scared! LOL
He's put a lot of thought and effort into what is maturing to be a great system, in his mind, for R&D. When everything is fully matured making a merge on sandbox will auto create a pr & merge onto core. This will facilitate the ability to roll out a new version of core very quickly, with the comfort in knowing everything has been tested thoroughly. There will still be a final test of the "build" of course but it should always be painless.
Breaking something in sandbox is as trivial a fix as deleting, or fixing, that branch and starting fresh from main. None of the day-to-day file changes that happen in core while testing effect Sandbox. It's completely isolated from the runtime(s). This is one of its major strengths. Your commits are completely and intentionally restricted to the "core" system.
What's it been like using Sandbox?
While Jacob has struggled with Sandbox, ALOT, Bear has been able to make it shine!
He uses it daily when making the changes that make Bearsampp mature. PR's are created from those changes, tested, most of the time by Jacob, and then merged into main when they have been successfully tested.
It's a tool that if/when more developers come onboard they will have a reliable and fully tested method of doing things to further the program along.
Can't I just use normal Bearsampp?
Yep! BUT, DON'T COME COMPLAINING TO BEAR WHEN YOU BOMB YOUR INSTALL! Don't think it can't happen to you, or "meh, easy to fix if it happens". You couldn't be further from the truth. Just recently Jacob bombed EVERY version of Bearsampp on his computer during testing of an encryption system. The hours of effort and frustration he spent trying to figure it out was not for the faint of heart. Jacob, to his merits, stuck with the battle and after many HOURS found out the real issue and its original cause. Bear had to admit to Jacob he would've never figured it out and that's not the first time or even second or third that something like this has happened. Jacob's tenacity, experience in IT has been instrumental in the growth of Bearsampp.
Furthermore using our main repo for R&D actually endangers our main repo because the rollbacks WILL happen! It takes a minimum of one to two hours to roll out a new version of Bearsampp WITHOUT anything going wrong so the lower the chances of something failing the better.
How long does it take to restore Sandbox when it bombs
Ideally? 30 seconds. IT SHOULD be as simple as destroying the branch and moving forward. But in the chance you have to nuke and start over, given a decent net connection, its a 15 min fix.
How exactly do I use Sandbox?
So, just like any other project you develop, you've created a branch, you've done some kind of an improvement to Bearsampp and your ready to fire it off. Great, one thing you'll notice is the iconography for Sandbox is different then for Bearsampp. This is by design. The color is a warning to you that your using a system designed for things to go wrong.
Run through the appropriate steps to test the changes you've made. Assuming those work then check EVERY function in Sandbox. The more thorough you are in this step the less work on everyone else who has to do the same thing to test your "fix". Lastly fire up localhost and make sure everything there works. Check the links, iconography, spinners, everything!
If everything looks ok, then commit, and create a pr. If you are part of the "codium" team, which you most likely are, there's no need for anything other then a title for the PR. PR-Agent Pro will do all the heavy lifting. Then just sit back and wait for the merge of your effort. Remove your local branch once your pr has been merged and start on the next issue. Don't be like Bear and forget to switch to main & creating a new branch before starting on the next thing. If you need some documentation on how the api works, then check out our API docs.
How can I use one database with multiple versions of mysql/mariadb?
To use a single database irregardless of the db version follow this video.
How can I help with development?
How do you change the about window?
The about window is a 450 x 250 window created by class.action.about.php
styling is in class.windbinder.php
specifically line 150
public function drawRect($parent, $xPos, $yPos, $width, $height, $color = 15790320, $filled = true)
{
return $this->callWinBinder('wb_draw_rect', array($parent, $xPos, $yPos, $width, $height, $color, $filled));
}
You must use decimal when working with colors such as https://convertingcolors.com/decimal-color-15790320.html
The hex value for the background is #f0f0f0
How do you change the bar color in left menu?
The bar color is controlled by Bearsampp\core\classes\tpls\class.tpl.aestan.php
lines 275-276
'BarGradientEnd=$00c07840' . PHP_EOL .
'BarGradientStart=$00c07840' . PHP_EOL .
The first 2 digits must always be '00' and the next 6 are in BBGGRR format
How do you replace the icons in Bearsampp.exe?
Icons for the start menu and shortcuts and such are contained inside Bearsampp.exe itself.
To change those requires a few steps...
- Create your new 128px x 128px image as a png.
- Go to https://www.freeconvert.com/png-to-ico and convert the png to .ico. I recommend you leave the settings at their default.
- Go to http://www.angusj.com/resourcehacker/ and install it.
- Within Resource Hacker open "Bearsampp.exe"
- Following the instructions on Resource Hacker website replace the existing icons Ctrl+R
- Compress and save
Keep in mind that modern windows can have many colors on the task bar and startup menu so the icon might be on a dark background or might be on a light background so choose your icon style appropriately.
How do you replace the icon in the menu tray?
The icon for inside the Bearsampp system tray, left menu, is in the bar.dat file in the root folder of Bearsampp.
Replacing the image in the icon tray takes a few steps...
- Create a 32x32 pixel transparent png
- Go to https://onlinepngtools.com/convert-png-to-bmp and convert that png to a .bmp
- Change the background color to match the color in
core\classes\tpls\class.tpl.aestan.php
'BarGradientEnd=$0030BF00' & 'BarGradientStart=$0030BF00'
- Change the background color to match the color in
- Now choose "Save as" and save it as "bar.dat" into the root of Bearsampp
How do you setup Bearsampp QuickPick service
Troubleshooting
How can I tell if a php extension is loaded?
If you can't trust phpinfo then you can check whether a php extension is loaded is very simply.
Open a command prompt and type php -i | findstr memcache replacing "memcache" with the module you'd like to check on.
You'll get a response similar to this...
PATH env. var is not resolved by Apache service
Services loaded with NSSM have the PATH environment variable rewritten.
Impacted services are : Apache, MailHog and Memcached.
As you can see you can add paths relative to the Bearsampp root folder (eg. www).
In the phpinfo the Apache environment will look like this :
And as you can see some paths are automatically added :
- %SystemRoot%\system32
- %SystemRoot%
- %SystemRoot%\system32\Wbem
- %SystemRoot%\system32\WindowsPowerShell\v1.0
- BEARSAMPP_PATH\bin\apache\apache*\bin
- BEARSAMPP_PATH\bin\php\php*
- BEARSAMPP_PATH\bin\php\php*\pear
- BEARSAMPP_PATH\bin\php\php*\imagick
- BEARSAMPP_PATH\bin\nodejs\nodejs*
- BEARSAMPP_PATH\bin\svn\svn*
- BEARSAMPP_PATH\tools\composer\composer*
- BEARSAMPP_PATH\tools\git\git*\bin
- BEARSAMPP_PATH\tools\imagemagick\imagemagick*
- BEARSAMPP_PATH\tools\python\python*\bin
- BEARSAMPP_PATH\tools\ruby\ruby*\bin
http.exe missing MSVCR100.dll
The program can’t start because MSVCR100.dll is missing from your computer. Try reinstalling the program to fix this problem.
This error occurs because you probably have not installed the latest Bearsampp Prerequisites Package.
Could not execute menu item (internal error)
Could not execute menu item (internal error)
[EAccessViolation] Access violation at address XXXXXXXX in module ‘neard.exe’. Read of address XXXXXXXX
Bearsampp tray icon is based on Aestan Tray Menu.
There are several cases to reproduce this error :
- Execute multiple actions at the same time.
- Do not wait for an action ends.
- A procedure error with Bearsampp based on
bearsampp.ini
file.
For the last case you will have to create an issue.
A service will not start and does not display error via the menu
Aestan Tray Menu built in service manager is not handled by Bearsampp in the Service menu
You can take look to the Windows Event Log to find out where the error occurred or use the Debug menu of the service (like Apache, MySQL or MariaDB).
If you still can't solve it you can try creating an issue and perhaps the community can help you solve it.
PostgreSQL start gives FATAL: role does not exist
When PostgreSQL is started as a service, you can have this error :
LOG: database system was shut down at 2013-06-13 00:54:33 UTC
LOG: autovacuum launcher started
LOG: database system is ready to accept connections
FATAL: role "John" does not exist
done
server started
This happens when you run pg_ctl start with the -w (wait) option like Bearsampp, because it will try a test connection with a user that does not exist (in your case). But that’s not really a problem (except for the confusing error message), because that proves that the server is up.
Why Bearsampp icon in the system tray is yellow or red?
Bearsmapp icon has 3 states :
- : All enabled services are started
- : One or more enabled services are stopped
- : All enabled services are stopped
To check from the Services Manager, click Start > Run and type services.msc
and check the status of Bearsampp* services :
Configuration
Why has xdebug stopped working?
Xdebug 3 completely changed how things are done. You can find a document explaining those changes here.
The default port is now 9003 instead of 9000
Due to those changes we've changed the way all future php releases are configured.
the [xdebug] section in php.ini will be changed to this.
[xdebug]
xdebug.mode = debug
xdebug.start_with_request = trigger
xdebug.output_name = cachegrind.out.%t.%p
xdebug.output_dir = "~BEARSAMPP_LIN_PATH~/tmp/cachegrind"
xdebug.var_display_max_children = "1024"
xdebug.var_display_max_depth = "8192"
xdebug.var_display_max_data = "32768"
xdebug.max_nesting_level = "250"
VMWare service uses port 80 and 443
According to VMWare Knowledge base article, connection to VMware Workstation Server (the shared virtual machines) is administered by the VMware Host Agent service. The service uses TCP ports 80 and 443. This service is also used by other VMware products, including VMware Server and vSphere, and provides additional capabilities.
This will block the execution of the Apache service on Bearsampp.
You can change the VMware Workstation Server ports when you install Workstation and after Workstation is installed.
To connect from a second instance of Workstation to Workstation Server:
- Go to File > Connect to Server.
- Enter the host name or IP address of the host machine running Workstation Server.
- When prompted, login with the username and password of a local administrator on the remote host.
Note: If the VMware Workstation Server service running on the remote server is not using the default port, you must specify the port number. For example, remotehost:444.
With the Shared VMs Workstation preferences, you can also disable the server. To access the Shared VMs Workstation preferences:
- Go to Edit > Preferences.
- Click the Shared VMs tab.
Since Chrome 58, self-signed certificates generated with Neard are no longer accepted and you will have the error NET::ERR_CERT_AUTHORITY_INVALID
if you go to https://localhost
.
Chrome only accepts insecure certificates on localhost by turning the flag chrome://flags/#allow-insecure-localhost
on Chrome. Or you can add the certificate to the Trusted Root Certification Authorities with the certutil command :
certutil.exe -addstore -user root "C:\bearsampp\ssl\localhost.crt"
Then restart Chrome.
ridk install
 used by the official installer.iisreset /stop
Â
Or you can change the port number of IIS by following the official Microsoft documentation.
Use port 80 and 443 as an alternative for additional incoming connections
 option. Click on the Save button and then restart Skype to make the change effective. alias\phpmyadmin.conf
 :<Directory "C:/neard/apps/phpmyadmin/phpmyadmin4p3/4.4.15.6/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
# START switchOnline tag - Do not replace!
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1
# END switchOnline tag - Do not replace!
<IfModule php5_module>
php_admin_value upload_max_filesize 128M
php_admin_value post_max_size 128M
php_admin_value max_execution_time 360
php_admin_value max_input_time 360
</IfModule>
<IfModule php7_module>
php_admin_value upload_max_filesize 128M
php_admin_value post_max_size 128M
php_admin_value max_execution_time 360
php_admin_value max_input_time 360
</IfModule>
</Directory>
There are two ways to disable some services to launch on startup.
First you can edit the neard.conf
 file and change the value to 0
 for keys ending with enable = "1"
 below BINS
.
Example:Â filezillaEnable = "0"
Or you can go to the Neard menu.
Example:Â Bearsampp tray menu > FileZilla > Enable / Disable
Here is an example using PDO to access a database namedÂ
wordpress
 installed on MySQL and MariaDB :
$mysql = new PDO('mysql:host=127.0.0.1;port=3306;dbname=wordpress', 'root', '');
$mysqlStmt = $mysql->query("SELECT * FROM wp_comments");
var_dump($mysqlStmt->fetchAll(PDO::FETCH_ASSOC));
$mariadb = new PDO('mysql:host=127.0.0.1;port=3307;dbname=wordpress', 'root', '');
$mariadbStmt = $mariadb->query("SELECT * FROM wp_comments");
var_dump($mariadbStmt->fetchAll(PDO::FETCH_ASSOC));
For each release there are "Upgrade notes" provided to guide you on how to upgrade.