Current path: home/webdevt/cryptoimpot.fr/
Local issue aupdate mac :
https://getgrav.org/blog/macos-bigsur-apache-multiple-php-versions
ps -ax | grep '[h]ttpd'
sudo lsof -a -iTCP -sTCP:LISTEN -c httpd
reinstall httpd
brew install httpd
A Cleaner Configuration
Before I being, I assume you already installed and configured Apache on Mac OS X.
First, open the Terminal app and switch to the root user to avoid permission issues while running these commands.
sudo su -
Edit the Apache configuration file:
vi /etc/apache2/httpd.conf
Find the following line:
#Include /private/etc/apache2/extra/httpd-vhosts.conf
Below it, add the following line:
Include /private/etc/apache2/vhosts/*.conf
This configures Apache to include all files ending in .conf in the /private/etc/apache2/vhosts/ directory. Now we need to create this directory.
mkdir /etc/apache2/vhosts
cd /etc/apache2/vhosts
Create the default virtual host configuration file.
vi _default.conf
Add the following configuration:
<VirtualHost *:80>
DocumentRoot "/Library/WebServer/Documents"
</VirtualHost>
I create this file to serve as the default virtual host. When Apache can not find a matching virtual host, it will use the first configuration. By prefixing this file with an underscore, Apache will include it first. Techincally this file is not needed as it simply repeats the configuraton already in httpd.conf. However, it provides a place to add custom configuration for the default virtual host (i.e. localhost).
Now you can create your first virtual host. The example below contains the virtual host configuration for my site. Of course, you will want to substitute jasonmccreary.me with your domain name.
Create the virtual host configuration file:
vi jasonmccreary.me.conf
Add the following configuration:
<VirtualHost *:80>
DocumentRoot "/Users/jimmy/Sites/ledgio2"
ServerName ledgio.local
ErrorLog "/private/var/log/apache2/ledgio2.local-error_log"
CustomLog "/private/var/log/apache2/ledgio2.local-access_log" common
<Directory "/Users/jimmy/Sites/ledgio2/public">
AllowOverride All
Require all
</Directory>
</VirtualHost>
This VirtualHost configuration allows me to access my site from http://jasonmccreary.local for local development.
Note: I use the extension local. This avoids conflicts with any real extensions and serves as a reminder I am developing in my local environment.
Note: The Require all granted configuration became available in Apache 2.4 which comes with Mac OS X Yosemite. If you are running a version of OS X before Yosemite, use the equivalent 2.2 configuration in the upgrading Apache examples.
The final step is to restart Apache:
apachectl restart
If you run into any problems, run:
apachectl configtest
This will test your Apache configuration and display any error messages.
Mapping the .local extension
In order to access sites locally you need to edit your hosts file.
vi /etc/hosts
Add a line to the bottom of this file for your virtual host. It should match the value you used for the ServerName configuration. For example, my site:
127.0.0.1 jasonmccreary.local
I like to run the following to clear the local DNS cache:
dscacheutil -flushcache
Now you can access your site using the .local extension. For example, http://jasonmccreary.local.
A note about permissions
You may receive 403 Forbidden when you visit your local site. This is likely a permissions issue. Simply put, the Apache user (_www) needs to have access to read, and sometimes write, to your web directory.
If you are not familiar with permissions, read more. For now though, the easiest thing to do is ensure your web directory has permissions of 755. You can change permissions with the command:
chmod 755 some/web/directory/
In my case, all my files were under my local ~/Documents directory. Which by default is only readable by me. So I had to change permissions from my web directory all the way up to ~/Documents to resolve the 403 Forbidden issue.
Note: There are many ways to solve permission issues. I have provided this as the easiest solution, not the best.
vhost :
https://htr3n.github.io/2017/09/apache-httpd-php-macos/
/usr/local/etc/httpd/extra/httpd-vhosts.conf
ssh -o IdentitiesOnly=yes jimmy@51.83.110.93
Prod : jimmy@hr3147433617:~/ledgio.fr$ /opt/plesk/php/7.3/bin/php ../bin/composer install
ErrorLog "/private/var/log/apache2/ledgio2-error_log"
CustomLog "/private/var/log/apache2/ledgio2-access_log" common
Worker queue pour API Kraken :
Command line :
```php public/index.php queue doctrine doctrineQueue --start``
Issue composer :
Add key :
composer config -g github-oauth.github.com 59c716ca35742509f28712e4ce5a8f67ca3da0df
vendor/bin/doctrine-module orm:generate-proxies
chmod 755 data/DoctrineORMModule/Proxy
En local disable dev :
composer development-disable
# ZendSkeletonApplication
## Introduction
This is a skeleton application using the Zend Framework MVC layer and module
systems. This application is meant to be used as a starting place for those
looking to get their feet wet with Zend Framework.
## Installation using Composer
The easiest way to create a new Zend Framework project is to use
[Composer](https://getcomposer.org/). If you don't have it already installed,
then please install as per the [documentation](https://getcomposer.org/doc/00-intro.md).
To create your new Zend Framework project:
```bash
$ composer create-project -sdev laminas/skeleton-application path/to/install
```
Once installed, you can test it out immediately using PHP's built-in web server:
```bash
$ cd path/to/install
$ php -S 0.0.0.0:8080 -t public/ public/index.php
# OR use the composer alias:
$ composer run --timeout 0 serve
```
This will start the cli-server on port 8080, and bind it to all network
interfaces. You can then visit the site at http://localhost:8080/
- which will bring up Zend Framework welcome page.
**Note:** The built-in CLI server is *for development only*.
## Development mode
The skeleton ships with [laminas-development-mode](https://github.com/laminas/laminas-development-mode)
by default, and provides three aliases for consuming the script it ships with:
```bash
$ composer development-enable # enable development mode
$ composer development-disable # disable development mode
$ composer development-status # whether or not development mode is enabled
```
You may provide development-only modules and bootstrap-level configuration in
`config/development.config.php.dist`, and development-only application
configuration in `config/autoload/development.local.php.dist`. Enabling
development mode will copy these files to versions removing the `.dist` suffix,
while disabling development mode will remove those copies.
Development mode is automatically enabled as part of the skeleton installation process.
After making changes to one of the above-mentioned `.dist` configuration files you will
either need to disable then enable development mode for the changes to take effect,
or manually make matching updates to the `.dist`-less copies of those files.
## Running Unit Tests
To run the supplied skeleton unit tests, you need to do one of the following:
- During initial project creation, select to install the MVC testing support.
- After initial project creation, install [zend-test](https://zendframework.github.io/zend-test/):
```bash
$ composer require --dev laminas/laminas-test
```
Once testing support is present, you can run the tests using:
```bash
$ ./vendor/bin/phpunit
```
If you need to make local modifications for the PHPUnit test setup, copy
`phpunit.xml.dist` to `phpunit.xml` and edit the new file; the latter has
precedence over the former when running tests, and is ignored by version
control. (If you want to make the modifications permanent, edit the
`phpunit.xml.dist` file.)
## Using Vagrant
This skeleton includes a `Vagrantfile` based on ubuntu 16.04 (bento box)
with configured Apache2 and PHP 7.0. Start it up using:
```bash
$ vagrant up
```
Once built, you can also run composer within the box. For example, the following
will install dependencies:
```bash
$ vagrant ssh -c 'composer install'
```
While this will update them:
```bash
$ vagrant ssh -c 'composer update'
```
While running, Vagrant maps your host port 8080 to port 80 on the virtual
machine; you can visit the site at http://localhost:8080/
> ### Vagrant and VirtualBox
>
> The vagrant image is based on ubuntu/xenial64. If you are using VirtualBox as
> a provider, you will need:
>
> - Vagrant 1.8.5 or later
> - VirtualBox 5.0.26 or later
For vagrant documentation, please refer to [vagrantup.com](https://www.vagrantup.com/)
## Using docker-compose
This skeleton provides a `docker-compose.yml` for use with
[docker-compose](https://docs.docker.com/compose/); it
uses the `Dockerfile` provided as its base. Build and start the image using:
```bash
$ docker-compose up -d --build
```
At this point, you can visit http://localhost:8080 to see the site running.
You can also run composer from the image. The container environment is named
"zf", so you will pass that value to `docker-compose run`:
```bash
$ docker-compose run zf composer install
```
## Web server setup
### Apache setup
To setup apache, setup a virtual host to point to the public/ directory of the
project and you should be ready to go! It should look something like below:
```apache
<VirtualHost *:80>
ServerName zfapp.localhost
DocumentRoot /path/to/zfapp/public
<Directory /path/to/zfapp/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</Directory>
</VirtualHost>
```
### Nginx setup
To setup nginx, open your `/path/to/nginx/nginx.conf` and add an
[include directive](http://nginx.org/en/docs/ngx_core_module.html#include) below
into `http` block if it does not already exist:
```nginx
http {
# ...
include sites-enabled/*.conf;
}
```
Create a virtual host configuration file for your project under `/path/to/nginx/sites-enabled/zfapp.localhost.conf`
it should look something like below:
```nginx
server {
listen 80;
server_name zfapp.localhost;
root /path/to/zfapp/public;
location / {
index index.php;
try_files $uri $uri/ @php;
}
location @php {
# Pass the PHP requests to FastCGI server (php-fpm) on 127.0.0.1:9000
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /path/to/zfapp/public/index.php;
include fastcgi_params;
}
}
```
Restart the nginx, now you should be ready to go!
## QA Tools
The skeleton does not come with any QA tooling by default, but does ship with
configuration for each of:
- [phpcs](https://github.com/squizlabs/php_codesniffer)
- [phpunit](https://phpunit.de)
Additionally, it comes with some basic tests for the shipped
`Application\Controller\IndexController`.
If you want to add these QA tools, execute the following:
```bash
$ composer require --dev phpunit/phpunit squizlabs/php_codesniffer laminas/laminas-test
```
We provide aliases for each of these tools in the Composer configuration:
```bash
# Run CS checks:
$ composer cs-check
# Fix CS errors:
$ composer cs-fix
# Run PHPUnit tests:
$ composer test
```