// start code(insert to database)
$sql=' SELECT * FROM short WHERE fullurl=:url1 ';
$rr->bindParam( ':url1', $path);
$num = $rr->rowCount();
if($num == 0)
$sql=' INSERT INTO short (fullurl,stime,sdate,scode) VALUES (:url1,:time1,:date1,:code1)';
$rr-> bindParam(':url1', $path);
$rr-> bindParam(':time1', $time2);
$rr-> bindParam(':date1', $date2);
$rr-> bindparam(':code1', $string);
echo "URL was added in the database";
echo "Not be added. Such addresses in the database is available";
// end code(insert to database)
With Laragon 3.1, you can work with multiple versions of Ruby (and therefore with multiple versions of Rails) easily. Here's how:
Download a Ruby 7z and 64-bit version on RubyInstaller: https://rubyinstaller.org/downloads/
Note: If you want to work with Rails in the meantime, you should use Ruby 2.2 or Ruby 2.3 64-bit
For example Ruby 2.2.6 (x64)
Extract it to bin\ruby:
Switch to the version:
Menu > Ruby > Version > ruby-2.2.6-x64-mingw32
That's all forks!
Open Terminal and check:
Note: adding another Ruby version also helps you install different versions of Rails: How to install Rails
As Laragon 3.0 has some breaking changes, we can follow these steps to safely upgrade Laragon.
Dump your database
Rename C:\laragon to C:\laragon2
Install Laragon to C:\laragon
Copy C:\laragon2\usr (User's settings) and C:\laragon2\www (Projects' data) to C:\laragon\usr and C:\laragon\www
Restore your database.
Brief: How to set the root password for MySQL to something other than blank.
Laravel Version: 2.1+
Works on Lower Version: Possibly - not tested.
Stop the MySQL service if it is running (Laragon will tell you to if you forget);
Enter the new password;
Start the MySQL service again if you would like it running.
There are a few ways to test if this worked:
Start the MySQL service if it is not started;
Right click the Laragon icon and with the Laragon->Database method go to Laragon's PHPMyAdmin (you may need to be running a web-server for this to work but we'll assume you have Nginx or Apache running else it's unclear why you might be using Laragon);
Use the username "root" and the password you entered above;
If you see the PHPMyAdmin page come up with no errors it worked.
Any error should be obvious.
Start the MySQL service if it is not started;
Start the web server (Apache / Nginx) if not started;
Make a Laravel project by right clicking the Laragon icon and with the Quick Create choose Laravel - it will require a database - WARNING: this may download quite a lot from the Internet so watch out if you're bandwidth poor;
In the command prompt window you'll see a failure to create a database if Laragon has misconfigured itself.
Another possible way, but possibly not as useful:
Find Laragon's laragon.ini;
Easiest by right clicking the Laragon icon and then Laragon->Settings file: laragon.ini;
Look for an entry called MySQLRootPassword - it is encrypted but so you won't be able to figure out if it is the "right" one but at least you'll be able to see that some password has been set.
BTW sometimes the Laragon icon may be hidden in the system tray or in the set of icons that appear when you click the "up" looking arrow in the Windows 10 taskbar (usually one or more icons to the left of the 'time').
Laragon bundles composer, nodejs, npm, git & git flow so there should be no problem if you want to work with projects on github.
In this tutorial, I'll show you how to work with Laravel 5 Boilerplate Project: https://github.com/rappasoft/laravel-5-boilerplate
Open Terminal (Menu > Laragon > Terminal or press CTRL + ALT + T)
Clone the repo to Document Root and cd to it:
git clone https://github.com/rappasoft/laravel-5-boilerplate
Run composer & npm to install all dependencies:
Create database for the project: Menu > MySQL > Create database
for example: laravel-5-boilerplate
Create your .env from .env.example
cp .env.example .env
Update your .env (change database connection properly)
Generate application key
php artisan key:generate
Init data to database
php artisan migrate
php artisan db:seed
Build the styles and scripts
npm run <command>
The available commands are listed at the top of the package.json file under the 'scripts' key.
After your project is installed you must run this command to link your public storage folder for user avatar uploads:
php artisan storage:link
PHPUnit (for https://github.com/rappasoft/laravel-5-boilerplate)
After your project is installed, make sure you run the test suite to make sure all of the parts are working correctly. From the root of your project run:
Login (for https://github.com/rappasoft/laravel-5-boilerplate)
After your project is installed and you can access it in a browser, click the login button on the right of the navigation bar.
Laragon 1.0.7 includes ngrok, an excellent tool to expose your local server behind a NAT or firewall to the internet.
This tutorial helps you to allow connections from outside to your [project.dev]
Make sure of our services is running (Start All), press Ctrl + Alt + T to open Terminal
Ctrl + Alt + T
Run ngrok by typing: ngrok http project.dev:80
ngrok http project.dev:80
Ngrok will start and show status screen, note for a domain which looks like this: xxxxxxxx.ngrok.io (in that case: 3e66ccf0.ngrok.io)
Forwarding http://3e66ccf0.ngrok.io -> project.dev:80
Open http-vhosts.conf (Menu > Apache > http-vhosts.conf), and add the domain to ServerAlias of project.dev Virtualhost entry:
<VirtualHost *:80> #laragon magic!
ServerAlias *.project.dev, 3e66ccf0.ngrok.io
Reload Apache (Menu > Apache > Reload). That's all.
DONE! You and your customers now can access your project.dev from anywhere using this url: http://3e66ccf0.ngrok.io
Note: The url will be changed each time you run ngrok.
Step 1: Download
Download the latest stable versions of Apache and PHP.
Step2: New Apache
Unzip the Apache download into [laragon installation dir]\bin\apache
Here it looks like: c:\Development\laragon\bin\apache\apache-2.4.20_64vc14
Remember to copy the httpd-vhosts.conf (virtual host file) from the working Apache.
I also changed the content of the httpd.conf (so it points to the correct directory). Perhaps Laragon does this automatically, IDK.
Step 3: New PHP
Unzip the PHP download into [laragon installation dir]\bin\php
Here it looks like: c:\Development\laragon\bin\php\php-7.0.6-64-ts
Change the php.ini to have the same extensions as the working php version.
(you can use a visual compare tool, like Winmerge, or Meld)
If you use xdebug, beware that a newer version of php also uses a different version of the xdebug setup.
Step 4: Try it
Now you can start Laragon, select the new 2 things and that should work.
Perhaps I forgot a few steps, but if you try and not succeed, please let me know, so we can figure this out.