wplib / wplib-box Goto Github PK
View Code? Open in Web Editor NEWThe Best Local Dev Server for WordPress Developers
Home Page: https://wplib.github.io/box-docs/
License: MIT License
The Best Local Dev Server for WordPress Developers
Home Page: https://wplib.github.io/box-docs/
License: MIT License
The current setting of upload_max_filesize=2m in /etc/php5/fpm/php.ini seems too low for a dev environment.
Nginx needs a corresponding parameter change:
http {
#...
client_max_body_size 8m; # match to what gets set in php.ini for upload_max_filesize
#...
}
https://easyengine.io/tutorials/php/increase-file-upload-size-limit/
I can get XDebug working with PHPStorm but not with Visual Studio Code.
Might be worth looking into this cause Visual Studio Code is free.
What should the content of the default homepage be?
I'm using wplib-box
without MySQL installed locally. When I use wp-cli db export
command, I get sh: mysqldump: command not found
.
I suspect that installing mysql client won't help much cause the DB is inside of the VM.
What's the recommended way of dumping the DB with the current setup?
The solution is to change the following line in /root/.profile
via the Packer script:
msg n
To be:
tty -s && msg n
See this for background
We might want to switch from HostsUpdater to HostsManager, because the latter has a way to show a UAC prompt, see #42.
It would be nice if there was some place you could subscribe to get notified about changes to box and so forth. Personally I usually miss the update available message during vagrant up/resume.
Add a cron task to auto-save the DB to /vagrant/sql/current.sql
Period: Every 5 minutes? Longer? Configurable?
I'd like to use xDebug. Is there a good way to do this?
Evidently, to avoid illegal tokens appearing in the middle of concatenated JS files we need to have sendfile set to off. Ref: http://stackoverflow.com/questions/12719859/no-visible-cause-for-unexpected-token-illegal/23487194#23487194
This should include some instructions regarding incorrect mounting of the shared webroot.
Also make sure HTTP_HOST works with it.
I get the following message in WP Admin on plugins page when I run 0.10.5 on MacOS.
( ! ) Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /var/www/wp/wp-includes/update.php on line 306
Causes seem to differ. VVV and others have this in their Vagrantfile to handle timeouts if I understand correctly.
config.vm.provider :virtualbox do |vb|
vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
vb.customize ['modifyvm', :id, '--natdnsproxy1', 'on']
end
I also added define('WP_HTTP_BLOCK_EXTERNAL', true); seem to have gone away then.
Per a question on Facebook asking it we are going to open source the "WP-specific config of the built box" I think we should create a repo for the starter site, such as:
wplib/site-box-single
Then we can manage this separately from the box packer?
Put files needing for provisioning into /srv/provision
to have a standard place and to remove the .tar
files from the /srv/sites
directory.
Also, I'd like to figure out a way that we can get users to be able to easily add things to their own repo that would a influence a reprovision, such as files for adding sites to nginx. This idea of fuzzy thus far, so just thinking "out loud."
Change composer to pull latest stable WordPress and when you get the ZIP file ready on provision have it use 4.5.
For some reasons some times nginx returns 404 for the main page when favicon.ico
is requested but not found. This happened in both Chrome and Safari and was pretty crazy to try and debug.
Need to add xdebug.idekey=PHPSTORM
added to 20-xdebug.ini
I like Blackfire and use it a bit. Im thinking this might be a candidate for some cli integration though.
wpbox add blackfire --provision
and it adds it and provisions server. or it can be flag in the vagrantfile or something.
Adding support for Blackfire I think would make a nice addition. However it can according to docs conflict with XDebug and XPerf. I haven't noticed anything.
Many people have asked to be able to run one VM to serve many different WordPress sites.
Since one of our core goals for WPLib Box is to provide a success experience as soon as possible once someone tries to install and use WPLib Box.
However, once someone has gotten initial success with WPLib Box we are happy to see them use it in more complex ways, and we want to fully support as much complexity as we can without compromising our core goals.
To that end we recommend Multi-Tenancy however we expect to support a symlink-free approach and embrace Composer instead. Consider the following planned directory structure on your Host Computer:
sites/site1.dev/www
sites/site2.dev/www
sites/site3.dev/www
sites/wp/4.4/
sites/wp/4.5/
sites/wp/4.6-beta/
This ticket is here as a TODO for us to do a proof-of-concept then write documentation for exactly how you would set this up as well as the pros and cons to our approach.
Later we will add commands in WPLib CLI to manage this all for you, such as:
wplib box expand [to multi-domain]
wplib box domain add <new_domain>
wplib box domain delete <new_domain>
WPLib Box is still pre-alpha and we have decided to change direction from what is online right now. Not sure how soon we can update it, but it is a top priority for us.
What we plan to move to is a pre-built collection of base boxes that include memcached, Redis, And Vagrant with a combinations of LAMP vs. LEMP (using MariaDB) and choice of PHP5.5, PHP5.6 and PHP7.0. The goal will be to create a box that will "up" and "reload" as quickly as possible and will have the fewest potential issues when getting to to work. And we will listen to users to see if we need to add any other base box configurations.
Further we plan to add a "box" command to a near future version of WPLib CLI for adding sites to the box and other admin task rather than requiring editing of the Vagrantfile and reprovisioning through Vagrant because that can be very time consuming and rather brittle.
With this we will de-emphasize constantly working with Vagrant and instead allow you to up
when you start your day and halt
when you end your day. Further, you would only need to use as many different boxes as you need different configurations; if you only ever need one configuration you could use one box for all your sites. But since you would not be having Vagrant process each of your sites it would not become more time consuming to bring up the new site because you would not have to reprovision.
This will allow the developer to pick the base box that best fits their needs. We can do this in the WodPress world because the best practices patterns for WordPress are so constrained vs. Ruby and Node projects, for example.
Instead the idea will be to use Vagrant to do what it alone currently does best; linking local development directories to the web home directories in the running boxes.
But we will do in a way that everything can be committed to version control because that is core to the vision for the WPLib platform.
Note, if anyone wants access to our WPLib Slack just ping team @ wplib.org me with your email address and we will add you.
The idea will be to have a WordPress website running in the Vagrant box that will show what websites are currently installed and what the status of their vagrants VMs are and the ability to control the VMs from the website as well as add and delete new websites. So the dashboard may simply be replaced with a (post) list of sites.
From there we can grow what it does (like keep track of things related to the deployment of the sites, etc.) but to start just having a list of sites, their Vagrant and Git statuses and ability to add or delete new sites will be a great thing.
We have one box image that can have everything installed on it so this admin console should also be able to start-stop the various services and switch between Apache and Nginx, MySQL and Maria DB and the various versions of PHP.
Class name must be a valid object or a string in /var/www/underscores4wplib/www/content/mu-plugins/wplib/modules/users/users.php on line 190
@mikeschinkel Your input is appreciated.
As we evangelize WPLib box it would be helpful to elicit support from 3rd party services like Pantheon.io and Blackfire.io if we can show them how many people are actually using WPLib Box, and how often.
I am proposing that we add an on-by-default feature that would periodically send a JSON file with non-confidential data representing various actions such as a reload or a provision so that we can keep track of how active our users are.
We should make it clear that we are doing this, show exactly what we are sending, and ask for people to not turn if off in order to support us. With that data I think we might be able to get sponsors to support the box.
When you ssh into vagrant I think that the directory you land in should be the default synced folder, site root. Currently you end up in the home directory. When directory matters thats where I usually want to go.
This ticket is here to collect up requests for supporting this feature. If you are interested in seeing WPLib Box support Parallels please add a comment with a +1 and any comments you'd like to share about about why WPLib Box needs to support Parallels. Thanks!
I think Mailcatcher or Mailhog integration would be a nice addition and it should be enabled by default.
https://github.com/sj26/mailcatcher is used by VVV. https://github.com/mailhog/MailHog looks more interesting I think at least the UI is prettier and there is less dependencies. It also has an REST API which could be usefull if one wants to make a plugin that integrates with the debug bar.
Both Mailcatcher and MailHog have dockercontainers.
I guess this would be in the packer image but its location referenced in this repo's readme?
Some of the goals for WPLib box are:
Running anything complicated for provisioning, or running anything that could potentially fail during provision then goes counter to these goals. Examples of things that could fail:
That means we cannot run anything more complex than a simple Bash script that downloads nothing for provisioning.
Thus to eliminate the need to run composer install
-- inside the box or out -- we should copy a ZIP file containing the WordPress website for wplib.box
from an /opt/provision
directory inside the box to the box's /var/www
directory (which maps to www/
in our host's directory) and then unzip it.
This will have the same effect as running composer install
as if composer install
was run at the time of box image creation instead of at time of first vagrant up
. That will give us a known working wplib.box
website and on that website we can provide instructions for the user that would include one of:
composer update
after running vagrant ssh
, orcomposer update
on the host machine after ensuring that composer is installed.add a database to use for unit/integration/acceptance testing
Presumably, the php GD module will be needed for many folks, so it should get auto-installed with the image.
Proposal: Import /vagrant/sql/default.sql
on (re-)provision; exact details to be decided.
Per suggestion in Slack https://wplib.slack.com/archives/box/p1461747628000125 we should look at the potential to store the MySQL files in a Vagrant shared folder to see if performance is reasonable and to see if doing so results in corruption of files or not.
To test the latter we'd need to try using it a while so we'd probably need a provision option to turn the feature on or off.
Discuss.
Some plugins uses the the salt constants. Consider adding them with default empty value in wp-config unless salt.php is found.
After Jayzanarak ProgrammerLoso got past issue #42 he then saw the symlinking of wp-redis/object-cache.php
fail, on Windows 10. See screenshot.
wpli.box
still loaded in his browser but the object cache won't work, obviously.
I know that @sarutole tested it on Windows 10 but I assume that he had already made a modification to his Windows box to enable this to work. That said, I have no idea why it was failing.
In order to be true to our (my?) claims that WPLib Box is the EASIEST way to setup a professional WordPress local development environment we need to solve this problem or at least change the documentation so that anyone who follows our QuickStart will not run into this problem.
Would be nice to have VMWare Fusion / Workstation support. The Vagrant box needs to be packed differently for those: https://www.vagrantup.com/vmware/
While looking at the contents of /var
to see if /var/www/content
was there (result of #43 ), I ssh-ed into the VM:
vagrant@wplib:/var/www$ ll
total 16
-rw-r--r-- 1 vagrant vagrant 0 Apr 20 02:14 =
drwxr-xr-x 1 vagrant vagrant 238 Apr 20 02:14 ./
drwxr-xr-x 12 root root 4096 Apr 20 02:08 ../
-rw-r--r-- 1 vagrant vagrant 0 Apr 20 02:14 default:
-rw-r--r-- 1 vagrant vagrant 85 Apr 20 02:02 index.php
-rw-r--r-- 1 vagrant vagrant 128 Apr 20 02:02 wp-config-local.php
-rw-r--r-- 1 vagrant vagrant 2558 Apr 20 02:02 wp-config.php
The result of a cat
is that it is empty
vagrant@wplib:/var/www$ cat default\:
vagrant@wplib:/var/www$
Jayzanarak ProgrammerLoso contacted me via Facebook Messenger with Vagrant Box install problem where Hosts Updater could not update the hosts
file on Windows 10. See screenshot.
I provided him these links and they gave him enough info to solve his problem, but he did not explain to me how he solved it (he had to leave for work that moment):
I know that @sarutole tested it on Windows 10 but I assume that he had already made a modification to his Windows box to enable editing of his hosts
file long before testing our box.
In order to be true to our (my?) claims that WPLib Box is the EASIEST way to setup a professional WordPress local development environment we need to solve this problem or at least change the documentation so that anyone who follows our quickstart will not run into this problem.
I installed the Layers theme and attempted to load it's Customization screen, and the site crashed. Checking the nginx error.log, it's throwing the below error. Granted, this appears to be an issue with the third-party code and I can try to fix that. But in the interests of making wplib-box the "Least Problematic" way to get a dev site up, it would be nice to make sure any errors can pass back up to the user's browser instead of having to dig into the VM and it's logs. I tried messing with fastcgi buffer sizes, but that didn't seem to help.
2016/04/13 21:00:36 [error] 1079#0: *91 FastCGI sent in stderr: "PHP message: PHP Notice: register_sidebar was called <strong>incorrectly</strong>. No <code>id</code> was set in the arguments array for the "Sidebar" sidebar. Defaulting to "sidebar-1". Manually set the <code>id</code> to "sidebar-1" to silence this notice and keep existing sidebar content. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 4.2.0.) in /usr/share/nginx/html/wp/wp-includes/functions.php on line 3901
PHP message: PHP Stack trace:
PHP message: PHP 1. {main}() /usr/share/nginx/html/wp/wp-admin/customize.php:0
PHP message: PHP 2. require_once() /usr/share/nginx/html/wp/wp-admin/customize.php:13
PHP message: PHP 3. require_once() /usr/share/nginx/html/wp/wp-admin/admin.php:31
PHP message: PHP 4. require_once() /usr/share/nginx/html/wp/wp-load.php:42
PHP message: PHP 5. require_once() /usr/share/nginx/html/wp-config.php:83
PHP message: PHP 6. do_action() /usr/share/nginx/html/wp/wp-settings.php:393
PHP message: PHP 7. call_user_func_array:{/usr/share/nginx/html/wp/wp-includes/plugin.php:525}() /usr/share/nginx/html/wp/wp-includes/plugin.php:525
PHP message: PHP 8. wp_widgets_init() /usr/share/nginx/html/wp/wp-includes/plugin.php:525
PHP message: PHP 9. do_action() /usr/share/nginx/html/wp/wp-includes/widgets.php:1475
PHP message: PHP 10. call_user_func_array:{/usr/share/nginx/html/wp/wp-includes/plugin.php:525}() /usr/share/nginx/html/wp/wp-includes/plugin.php:525
PHP message: PHP 11. layers_add_sidebars() /usr/share/nginx/html/wp/wp-includes/plugin.php:525
PHP message: PHP 12. register_sidebar() /usr/share/nginx/html/content/themes/layers/functions.php:17
PHP message: PHP 13. _doing_it_wrong() /usr/share/nginx/html/wp/wp-includes/widgets.php:258
PHP message: PHP 14. trigger_error() /usr/share/nginx/html/wp/wp-includes/functions.php:3901
PHP message: PHP Notice: register_sidebar was called <strong>incorrectly</
2016/04/13 21:00:36 [error] 1079#0: *91 upstream sent too big header while reading response header from upstream, client: 192.168.33.1, server: localhost, request: "GET /wp/wp-admin/customize.php?url=http%3A%2F%2Fwplib.box%2F HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "wplib.box", referrer: "http://wplib.box/"
Since you need to run phpunit in the VM for the WP integration test to work adding it either to box or during provision would be good. If provision probably some check if installed should be added so it doesn't get redownloaded or anything like that unless there is update.
Ensure that latest code is on GitHub the delete BitBucket.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.