MAMP.ONE

web publishing magazine

How to install Laravel in to a MAMP PRO document root

  1. Install Composer (See https://getcomposer.org/doc/00-intro.md)
  2. Create a host laravel.test with database laravel_test in MAMP PRO
  3. Open the terminal and cd to the document root of the laravel.test host
  4. type the following in the terminal (without quotes): “composer create-project –prefer-dist laravel/laravel .” <- Make sure not to forget the dot!
  5. After installation, open the hidden file .env (which is located in the document root) in any text editor of your choice
  6. Setup the db section like this:

DB_CONNECTION=mysql
DB_HOST=localhost;unix_socket=/Applications/MAMP/tmp/mysql/mysql.sock
DB_PORT=3306
DB_DATABASE=laravel_test
DB_USERNAME=root
DB_PASSWORD=root

If you have a different user and password for mysql you need to use these instead of root/root

7. Open the file config/database.php and set database there too:

‘mysql’ => [
‘driver’ => ‘mysql’,
‘host’ => env(‘DB_HOST’, ‘localhost’),
‘port’ => env(‘DB_PORT’, ‘3306’),
‘database’ => env(‘DB_DATABASE’, ‘laravel_test’),
‘username’ => env(‘DB_USERNAME’, ‘root’),
‘password’ => env(‘DB_PASSWORD’, ‘root’),
‘unix_socket’ => env(‘DB_SOCKET’, ‘/Applications/MAMP/tmp/mysql/mysql.sock’),
‘charset’ => ‘utf8mb4’,
‘collation’ => ‘utf8mb4_unicode_ci’,
‘prefix’ => ”,
‘prefix_indexes’ => true,
‘strict’ => true,
‘engine’ => null,
‘options’ => extension_loaded(‘pdo_mysql’) ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env(‘MYSQL_ATTR_SSL_CA’),
]) : [],
],

8. Copy the hidden “.htaccess” file from the “public” folder directly in the document root of your laravel.test host

9. Rename server.php into index.php

Thats it. Now you should be able to call http://laravel.test to see the starting page of laravel

To add the default databases and tables you need to migrate them. This is done like this:

  1. Be sure MAMP PRO is running
  2. Open the terminal and cd to the document root of the laravel.test host
  3. Type “php artisan migrate”

You should see something like this:

Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_000000_create_users_table
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated: 2014_10_12_100000_create_password_resets_table

Now everything works like described in the documentation of laravel (e.g. installing new modules, creating new migrations, etc)

If you make changes in one of the config files you always need to cd to the document root of the laravel.test host and call “php artisan config:cache” in the terminal


WordPress 5.1 out now

More performance and more security

WordPress 5.1 is codenamed “Betty” and focuses on the Gutenberg block editor introduced in the previous version. Users have now a faster access and the text input  is smoother. WordPress stated that the next updates will continue here.

Besides “Betty” introduces the Site-Health-Feature. This warns users if the PHP version they are using is outdated. The function also notifies users if they want to install a plugin that requires a newer PHP version. So far WordPress had only checked if the WordPress version is up-to-date enough.

In addition, WordPress has integrated a new JavaScript build process and added new filters to the Cron API to modify the cron memory. WordPress 5.1  comes with a new database table that lets the CMS store multisite metadata.


Security support for PHP 5.6 and PHP 7.0 expires

The final support end of PHP 5.6 and 7.0 has been reached. Admins should upgrade to a supported version.

No more security updates: Security support for PHP 5.6 expires on December 31, 2018. For PHP 7.0 this was already the case on December 03. Website admins should act immediately and install a current PHP version. The problem is that lots of websites are still using PHP versions that are no longer in security support. According to the statistics service W3Techs, almost 80 percent of all websites currently use PHP. Version 5 is still used in around 60 percent of these sites. But it is progressing: In October this was still the case with about 80 percent. For their statistics W3Techs evaluates among other things data of 10 million Websites, which come from the analysis service Alexa according to own data.


December 19, 2018 — Oliver

MAMP PRO 5.2 with Dark Mode support released

MAMP & MAMP PRO 5.2 is available for download.
We have added 3 new PHP versions: 7.0.3.2, 7.1.22 and 7.2.10

The most important change is the support of Dark Mode for macOS 10.14.

Further changes are:

  • Remote tab: Auto-detection function to detect a remote document root
  • Auto-create certificate and key in /Applications/MAMP/Library/OpenSSL/certs when creating a new SSL host
  • Improved verification of update packages
  • Improved memory handling
  • Newly created snapshot files can be imported even after they have been renamed.
  • Editor: Fixed a memory leak, Optimized color themes




MAMP & MAMP PRO —
Version 5.1.1 released

We’ve just released version 5.1.1 of MAMP PRO. This update is only available via the in-app update function of MAMP PRO and contains some bug fixes and improvements.

  • When installing WordPress you need to create an admin name and password.
  • Using single quotes in WordPress passwords no longer crash the application.
  • Hardened host import and publish functions against network interruptions
  • Improved loading from Cloud in PHP cgi mode
  • Fixed a bug when reloading the hosts table

Please note: This version introduces an improved Cloud archive format which older versions can NOT read! Updating all your installations to version 5.1.1 solves this.

Don’t hesitate to report any other bug you may find to our bugbase so we can fix it as quickly as possible.


CSS Grid —
More flexibility with minmax()

CSS Grid is a great way to create complex layouts. But sometimes you need a little more flexibility to set the width of the columns. This is where the CSS function minmax() comes in. Here you will find a very good description of how to use this CSS function.

minmax() is a function that can be used in your grid-template-columns or grid-template-rows property to size your grid tracks. It takes (you guessed it) a minimum value and a maximum value, which can be a length (pixels, ems, etc.), a percentage, a flexible fr unit or a keyword.


What browser am I using?

As a front-end developer, you are currently implementing a layout and the customer writes you that a few things are still not working properly. You cannot reproduce the problems and want to know which browser (and which version) and which operating system they are using. No problem. Even if your customer is not very technically experienced, he can get all desired information from the website “What’s my browser” or “mybrowser.fyi” and then tell you.


Experimental layouts with CSS Shapes and clip-path

In the last article we already mentioned the future of CSS. Also today we would like to draw your attention to a CSS feature, which is still not used very often. This is probably due to the still somewhat incomplete support on the part of the current browsers, on the one hand, but also to several problems when it is used on responsive websites. We are talking about CSS shapes. In the article “Experimental layouts with CSS Shapes and clip-path” you will find a lot of practical information and of course some examples.


September 19, 2018 — Dirk Einecke

MAMP & MAMP PRO —
Version 5.1 released

We’ve just released version 5.1 of MAMP & MAMP PRO. This update is available for download and contains some bug fixes and improvements.

MAMP & MAMP PRO

  • Updated components
    • MySQL 5.7.23
    • phpMyAdmin 4.8.3
  • New components
    • Extensions to use Redis from PHP, Perl, Python & Ruby

MAMP

  • Fixed a crash when retrieving the MySQL password

MAMP PRO

  • The Create Snapshot toolbar item gets highlighted again when a snapshot is being created.
  • The Memcached and Redis extensions for PHP are now only enabled when GroupStart is enabled for these servers.
  • PHP versions can be removed from inside MAMP PRO.
  • Fixed a crash when reading the user ID
  • Edit windows support proxy icons in the titlebar – when possible.
  • The checkbox “Automatically resolve aliases and symbolic links” now works correctly in open dialogs.
  • You can no longer create snapshots if there is not enough free disk space.
  • Host-specific ports are no longer ignored.
  • Fixed a crash when creating/restoring a snapshot
  • Added MySQL user “mamp” as a “root” stand-in for emergencies

Don’t hesitate to report any other bug you may find to our bugbase so we can fix it as quickly as possible.


On switching from HEX & RGB to HSL

Most of us web developers still use the Hexadecimal and RGB(A) color formats to specify color values. However, there are signs of a turnaround towards the HSL format. Why you should change and how this could happen can be read in the article “On Switching from HEX & RGB to HSL” by Sara Soueidan (Freelance Front-End Web UI/UX Developer from Lebanon).


August 20, 2018 — Dirk Einecke

MAMP PRO —
Version 5.0.4 released

We’ve just released version 5.0.4 of MAMP PRO. This update is only available via the in-app update function of MAMP PRO and contains some bug fixes and improvements.

  • MySQL no longer wrongly reports failed starts.
  • Redis starts more reliably when using the ‘redis’ user account.
  • Editor
    • Fixed an auto layout bug on Mac OS X 10.10
    • No longer crashes when opening a file in a new window
  • MAMP PRO can now start the update of the complete MAMP package.
  • Automatically created snapshots now have “[auto]” in their name.
  • When purging old snapshots “[auto]” snapshots are removed first, then the oldest snapshots, until only 100 or less snapshots per host are left.
  • Included remote server information in Summary
  • Inactive hosts will no longer be written to the /etc/hosts file.
  • Fixed an exception when updating a component
  • A new toolbar item to show/hide the sidebar of the main window
  • Added publish and import host entries to the contextual menu of the hosts’ list and the action menu
  • Added progress indicator to update window
  • Reduced use of external tools

Don’t hesitate to report any other bug you may find to our bugbase so we can fix it as quickly as possible.


New icons for your website

If the icons of Font Awesome (or similar projects) do not match your creative website, then theDoodleLibrary is definitely worth a look.

theDoodleLibrary is an expanding collection of reusable simple drawings and doodles in a vector (SVG) format. The images are free to share and adapt – mix and match to create visual stories that increase comprehension, retention and delight your audience.


MAMP PRO —
Xdebug with Visual Studio Code

If you work quite often with PHP, you will soon notice that debugging with the functions print_r() and var_dump() is quite difficult and do not always lead to the target. For this reason there is the PHP extension Xdebug. This PHP extension is already integrated into MAMP PRO and you only have to activate it by clicking a checkbox.

Now all that is missing is a nice visual presentation of the data provided by Xdebug. For example, you can use Visual Studio Code (VSC). For this editor there is an excellent extension “PHP Debug” by Felix Becker. To install, simply open the extension view in VSC and search for “PHP Debug”, click on the green “Install” button and your environment is ready.

Now you are not only informed about errors you made during programming, but you can also examine all variables and their values during the runtime of your PHP program by setting breakpoints. Only in this way it is possible to develop websites efficiently and professionally with PHP.