Skip to content

Instantly share code, notes, and snippets.

@Rrrapture
Last active July 20, 2017 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rrrapture/0f24de3e6f7f8bce7983530b168c7391 to your computer and use it in GitHub Desktop.
Save Rrrapture/0f24de3e6f7f8bce7983530b168c7391 to your computer and use it in GitHub Desktop.
LAMP laravel aimeos install - Mac - local
laravel-local-install-setup.txt
https://github.com/revolunet/sublimetext-markdown-preview/blob/master/README.md
specific to El Capitan, should work in Sierra as well
2017-04-21
https://laravel-news.com/laravel-5-5-php-7-0
< there we go!
https://developerjack.com/blog/2016/08/26/Installing-PHP71-with-homebrew/
************
***********
************
recommends apache and php with brew
* I followed this one. Still want to:
done 1. delete 7.0 half install,
done 2. and move over existing vhosts from old system apache setup.
3. Fix vhosts so they run in localhost
done 4. moved other from var/www/ to Sites
5. make sure it works.
https://lukearmstrong.github.io/2016/12/setup-apache-mysql-php-homebrew-macos-sierra/
view at http://php71.apache.localhost
also a good reference, describes some other aspects of the
https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions
hmmmm
https://aimeos.org/project/shop-features/
how is it responsive?
see screenshots of demo site. Total lie that it's responsive
from 320px wide on product detail page.
https://aimeos.com/support/
Our support package
2 or 4 hour support
Personal e-mail support
Direct developer support
Remote support via web or SSH
Monday - Friday (business days), 9-17 UTC
Reaction time within 24 business hours
In English and German
For more than 4 hours support, change the quantity accordingly.
https://aimeos.com/support/#extended-lts
https://aimeos.org/project/roadmap/
2017
Extended JQAdm administration interface
Market place for extensions
Drupal integration
2018+
Twitter Bootstrap based frontend layout
Use PSR-7 for updateSync() methods in service providers
Own updatePush() method for push status updates in service providers
Merge order base item/manager PARTS_* constants
Rename templates to "...-standard.php"
Unify inject*() methods in factories
NoSQL database support
Frontend editing
Wordpress integration
testing:
did you restart apachectl?
can you go here? http://php71.apache.localhost/
can you go to localhost of project you want in your sites folder?
http://laravel.localhost/
see demo site:
http://laravel.localhost/list
ok maybe it's good now, but I need to check if laravel is installed, and artisan key gen
what branch am i on?
is composer installled?
do i need aimeos installed?
ok now for laravel:
https://laravel.com/docs/5.4/installation
we are still on 5.3 but the following is ok
requirement: Composer installed globally as a system wide executable.
https://getcomposer.org/download/, (using commandline install), then run `mv composer.phar /usr/local/bin/composer`
https://getcomposer.org/doc/00-intro.md#globally
- composer global require "laravel/installer"
- place the $HOME/.composer/vendor/bin directory (or the equivalent directory for your OS) in your $PATH so the laravel executable can be located by your system.
(ie ) export PATH=$HOME/.composer/vendor/bin:$PATH
- If you have already cloned an existing Laravel project repo, there's no need to create a new Laravel project as your repo will already have the Laravel files.
************
***********
************
- Directory Permissions
After installing Laravel, you may need to configure some permissions. Directories within the storage and the bootstrap/cache directories should be writable by your web server or Laravel will not run.
Warning: require(/Users/username/Sites/project/laravel/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/username/Sites/project/laravel/bootstrap/autoload.php on line 17
- https://laracasts.com/discuss/channels/general-discussion/laravel-framework-file-permission-security
Most folders should be normal "755" and files, "644"
Laravel requires some folders to be writable for the web server user. You can use this command on *nix based OSs.
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
or
chgrp apache /path/to/mydir
chmod g+w /path/to/mydir
1. https://laracasts.com/discuss/channels/laravel/appstorage-chmod-777-safe
2. https://www.g-loaded.eu/2008/12/09/making-a-directory-writable-by-the-webserver/
bgies comment most explicit
The NORMAL way to set permissions is to have your files owned by the webserver:
sudo chown -R www-data:www-data /path/to/your/root/directory
if you do that, the webserver owns all the files, and is also the group, and you will have some problems uploading files or working with files via FTP, because your FTP client will be logged in as you, not your webserver, so add your user to the webserver user group:
you need to give read and write permissions to the webserver for storage, cache and any other directories the webserver needs to upload or write too (depending on your situation), so run the commands from bashy above :
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
Now, you're secure and your website works, AND you can work with the files fairly easily (
I'm using brew's httpd24 web server - the user/group is daemon
prefer:
sudo chgrp -R daemon storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
************
***********
************
next steps:
- rename .env.example to .env, and enter the correct values
(see sample text file, not included in this gist.)
- need to check on mysql db local version
- did you run keygen artisan command yet?
run `php artisan key:generate` command
https://laravel.com/docs/5.4/installation Application Key
<<< before that can be done successfully, even after permissions are changed,
you run
composer update
and it gives you thi error:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for mpociot/couchbase ^0.2.0 -> satisfiable by mpociot/couchbase[0.2.0].
- mpociot/couchbase 0.2.0 requires ext-couchbase >=2.2.0 -> the requested PHP extension couchbase is missing from your system.
To enable extensions, verify that they are enabled in your .ini files:
- /usr/local/etc/php/7.1/php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
So you must next make sure you resolve those issues (more below) with:
brew install libcouchbase
and
brew install homebrew/php/php71-couchbase
then then you can successfully run composer install
then
after it's installed,
then you can run php artisan key:generate
If you have not renamed the .env.example file to .env, you should do that now. If the application key is not set, your user sessions and other encrypted data will not be secure!
.env.example file to .env
So instead of `composer create-project --prefer-dist laravel/laravel blog`, if it’s an existing laravel repo you just cloned, run `composer update`
*********
*********
********
couchbase install
If couchbase is in the repo, install couchbase PHP driver
(hint: if running `composer install` returns the following error, you need it:
error - merge
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for mpociot/couchbase 0.2.0 -> satisfiable by mpociot/couchbase[0.2.0].
- mpociot/couchbase 0.2.0 requires ext-couchbase >=2.2.0 -> the requested PHP extension couchbase is missing from your system.
To enable extensions, verify that they are enabled in your .ini files:
- /usr/local/etc/php/7.1/php.ini
- /usr/local/etc/php/7.1/conf.d/ext-mcrypt.ini
- /usr/local/etc/php/7.1/conf.d/ext-xdebug.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
1. Make sure the service provider is in: laravel-project-name/config/app.php:\
`Mpociot\Couchbase\CouchbaseServiceProvider::class,`
2. run:
brew update # get list of latest packages
brew install libcouchbase
# brew install homebrew/php/php{XY}-couchbase, where XY is your version of PHP
brew install homebrew/php/php71-couchbase # for PHP 7.1
Then run:
`composer install`
************
***********
************
make a mysql db
(named to match the value in your local laravel-project-name/.env file
(assumes mysql install / mysqladmin install, through homebrew is convenient
https://dev.mysql.com/doc/refman/5.7/en/connecting-disconnecting.html)
https://dev.mysql.com/doc/refman/5.7/en/database-use.html
Find out about dbs in your mysql `SHOW DATABASES();` , which is selected? `SELECT DATABASE();`
************
***********
************
https://github.com/aimeos/aimeos-laravel#aimeos-laravel-package
https://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
- As of MySQL 5.7.18, my-default.cnf is no longer included in or installed by distribution packages.
setup my.conf
mysql> SELECT VERSION(); 5.7.18
SO MAKE ONE
https://dev.mysql.com/doc/refman/5.7/en/option-files.html
Table 5.2 Option Files Read on Unix and Unix-Like Systems
File Name Purpose
/etc/my.cnf Global options
/etc/mysql/my.cnf Global options
SYSCONFDIR/my.cnf Global options
$MYSQL_HOME/my.cnf Server-specific options (server only)
defaults-extra-file The file specified with --defaults-extra-file, if any
~/.my.cnf User-specific options
~/.mylogin.cnf User-specific login path options (clients only)
************
***********
************
mysqlconf file needs to be created
Out of sort memory, consider increasing server sort buffer size
see:
MySQL 5.6.4+ installations have a very low value for the sort_buffer_size setting by default. If you get an error like this:
SQLSTATE[HY001]: Memory allocation error: 1038 Out of sort memory,
consider increasing server sort buffer size
Add that line to your MySQL my.cnf configuration file and restart the MySQL daemon:
sort_buffer_size=1M
https://github.com/aimeos/aimeos-laravel#aimeos-laravel-package
so make a file based on
https://coderwall.com/p/1_nkpq/osx-mysql-configuration
put it higher up than the particular version
https://dev.mysql.com/doc/refman/5.7/en/glossary.html#glos_configuration_file
my.cnf
The name, on Unix or Linux systems, of the MySQL option file.
See Also my.ini, option file.
Table 5.2 Option Files Read on Unix and Unix-Like Systems
explains what different ones / locations are for.
https://dev.mysql.com/doc/refman/5.7/en/option-files.html
finallY;
this makes sense: https://forums.mysql.com/read.php?11,366143,376017#msg-376017
- You will now have a copy of my.cnf in /etc (just in case you don't know, that means the etc folder directly under the root folder, not under MySQL's install folder)
$ cd /etc
$ sudo touch my.cnf
use this as a template:
https://coderwall.com/p/1_nkpq/osx-mysql-configuration
only set sort_buffer_size=1M
based on Aimeos recommendation
so:
# MySQL overrides
# https://coderwall.com/p/1_nkpq/osx-mysql-configuration
# Sort buffer set to 1M for Laravel > Aimeos
[mysqld]
sort_buffer_size=1M
Once edited restart mysql-server?
I exited mysql command line monitor, is that the same thing?
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.7.18 Homebrew
************
***********
************
Once edited restart your mysql server:
try this! yes!
(homebrew example I have)
$ brew services restart mysql
************
***********
************
NOW GO BACK AND TRY
php artisan aimeos:setup --option=setup/default/demo:1
it's successful!
************
***********
************
https://github.com/aimeos/aimeos-laravel#aimeos-laravel-package
- for dummy catalog data, php artisan aimeos:setup --option=setup/default/demo:1
??
- you also need to add the Aimeos service provider to app.php, it covers that pretty well at the link above
************
***********
************
note 2017-05-03 at this point I merge develop into my ftp-develop branch
getting error
FatalThrowableError in ProviderRepository.php line 146:
Class 'Collective\Html\HtmlServiceProvider' not found
next:
composer update
************
***********
************
WAIT, THIS?
https://github.com/aimeos/aimeos-laravel#admin
SETTING UP THE LARAVEL AUTHENTICATION
NEEDED FOR EXISTING PROJECT? https://laravel.com/docs/5.4/authentication
AND THIS TOO? OY
As a last step, you need to extend the boot() method of your App\Providers\AuthServiceProvider class and add the lines to define how authorization for "admin" is checked in app/Providers/AuthServiceProvider.php.
For Laravel 5.3/5.4 and Aimeos 2017.x use instead:
public function boot()
{
// Keep the lines before
Gate::define('admin', function($user, $class, $roles) {
return app( '\Aimeos\Shop\Base\Support' )->checkGroup( $user->id, $roles );
});
}
*******
*******
regarding: - you also need to add the Aimeos service provider to app.php, it covers that pretty well at the link above
so check in app/Providers/AppServiceProvider.php
************
***********
************
- Local Development Server
If you have PHP installed locally and you would like to use PHP's built-in development server to serve your application, you may use the serve Artisan command. This command will start a development server at http://localhost:8000:
php artisan serve
http://php.net/manual/en/install.unix.php
************
***********
************
https://github.com/Homebrew/homebrew-php
************
***********
************
also offers coaching
https://jason.pureconcepts.net/2016/04/mentoring-pair-programming-development-coaching/
tdd: laravel shift: https://twitter.com/laravelshift
https://jason.pureconcepts.net/2016/09/upgrade-php-mac-os-x/
************
***********
************
https://apple.stackexchange.com/questions/171682/php-version-shown-in-command-line-differs-from-phpinfo-in-localhost8000
The new version of PHP needs to be in your $PATH and the path to the new version of php needs to be listed before /usr/bin. If the new version of php (the executable) is installed in /usr/local/bin/ you should be in good shape, otherwise you need to either link the new php executable there (ln -s /path/to/newphp /usr/local/bin/php) or add it's location to your $PATH (export PATH=/path/to/newphp:"${PATH}") (<- add this to your ~/.bash_profile).
One other possibility to check... is the new version of php named php? It's possible that it will be named something like php5 or some such thing. If so you'll need to create a a link or use that name on the command line.
**************
**************
**************
https://garthkerr.com/composer-install-on-os-x-10-11-el-capitan/
composer should be in /usr/local/bin:
(if after installing composer)
sudo mv /Users/rachellegray/composer.phar /usr/local/bin/composer
in .bash_profile:
add to path
export PATH=$HOME/.composer/vendor/bin:$PATH
run `composer` to see commands
other prereqs:
If you're using elixir, gulp CLI should be installed globally
(laravel 5.3/5.4 docs walk you through that too. If you are using homestead you don't need to do that manually
https://laravel.com/docs/5.4/mix#installation)
npm install --global gulp-cli
if you're using mix, you don't need to install gulp-cli
either way you need npm & node installed globally.
global npm v5.0.3, global node v8.1.2 (install with brew: brew install node)
until 5.0.3 npm package-lock.json sub dependencies bugs fixed, can use an .npmrc file with package-lock=false option.
@Rrrapture
Copy link
Author

make a note about admin setup - login, cms for non-store content

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment