Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to install wallabag without dev deps #1617

Closed
j0k3r opened this issue Jan 22, 2016 · 22 comments
Closed

Ability to install wallabag without dev deps #1617

j0k3r opened this issue Jan 22, 2016 · 22 comments
Milestone

Comments

@j0k3r
Copy link
Member

j0k3r commented Jan 22, 2016

When using composer create-project, users will have the full deps (including dev one, like PHPUnit). They don't need them.

We should be able to launch composer create-project [...] --no-dev. But some bundles in require-dev are required in non-dev.

PHP Fatal error: Class 'Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle' not found in /private/tmp/wallabag/app/AppKernel.php on line 41

@j0k3r j0k3r added this to the 2.0.0-beta.1 milestone Jan 22, 2016
j0k3r added a commit that referenced this issue Feb 4, 2016
So the only solution I found so far is to force the `prod` env when create the project with composer.
There is other solution.

Since the `cache:clear` task is using `dev` env by default, so it tries to load dev bundle, which aren't there since we specify `--no-dev`.

Fix #1617
@0wnrepo
Copy link
Contributor

0wnrepo commented Feb 7, 2016

I'm also having this issue. Installed with

SYMFONY_ENV=prod composer create-project wallabag/wallabag wallabag "2.0.0-alpha.2" --no-dev

Is it possible to use the latest commit instead of "2.0.0-alpha.2" ?

@j0k3r
Copy link
Member Author

j0k3r commented Feb 7, 2016

You can try with the last commit by using 2.x-dev instead of 2.0.0-alpha.2.

Le 7 févr. 2016 à 22:05, 0wnrepo notifications@github.com a écrit :

I'm also having this issue. Installed with

SYMFONY_ENV=prod composer create-project wallabag/wallabag wallabag "2.0.0-alpha.2" --no-dev

Is it possible to use the latest commit instead of "2.0.0-alpha.2" ?


Reply to this email directly or view it on GitHub.

@0wnrepo
Copy link
Contributor

0wnrepo commented Feb 7, 2016

This should be updated on README.md, right ? As the command used there is not working as the moment, until the next drop.

Testing your fix
got

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 134217728 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php on line 214

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.[edited]-MacBook-Pro:wallabag [edited]$ 

investigating, this could be a low space error from my side.

Fixed the above by increasing the default 128MB to 1G (steps for non-developers) in /etc/php.ini.default and removing the .default extension. (MAC OS 10.10.5)

Still having this issue, I've run

Edited-MacBook-Pro:x edited$ php -r "echo ini_get('memory_limit').PHP_EOL;"
1G

Any thoughts ?

@j0k3r
Copy link
Member Author

j0k3r commented Feb 8, 2016

@0wnrepo using a non-existing tag when creating a project will require that we need to build the dependencies for the project. And it takes a lot (I mean, a lot) of memory. That's why we fix deps on each release to avoid this calculation on the user side.

You should try this, which isn't really recommended, but might work (depending on where your composer bin is installed):

SYMFONY_ENV=prod php -d memory_limit=-1 /usr/bin/composer create-project wallabag/wallabag wallabag "2.x-dev" --no-dev

@0wnrepo
Copy link
Contributor

0wnrepo commented Feb 8, 2016

Tried the above command but still no luck

 Installing craue/config-bundle (1.4.1)
    Downloading: 100%         

Writing lock file
Generating autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Creating the "app/config/parameters.yml" file
Some parameters are missing. Please provide them.
database_driver (pdo_sqlite): 
database_host (127.0.0.1): 
database_port (null): 9000
database_name (symfony): 
database_user (root): 
database_password (null): test
database_path ('%kernel.root_dir%/../data/db/wallabag.sqlite'): 
database_table_prefix (wallabag_): 
test_database_driver (pdo_sqlite): 
test_database_host (127.0.0.1): 
test_database_port (null): 9001
test_database_name (null): testdb
test_database_user (null): root
test_database_password (null): test
test_database_path ('%kernel.root_dir%/../data/db/wallabag_test.sqlite'): 
mailer_transport (smtp): 
mailer_host (127.0.0.1): 
mailer_user (null): root
mailer_password (null): test
locale (en): 
secret (ovmpmAWXRCabNlMgzlzFXDYmCFfzGv): secret
twofactor_auth (true): 
twofactor_sender (no-reply@wallabag.org): 
fosuser_confirmation (true): 
from_email (no-reply@wallabag.org): 
 Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
 Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache

Fatal error: Class Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle not found in /Users/ed/Desktop/walla/wallabag/app/AppKernel.php on line 43
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-cmd event terminated with an exception


  [RuntimeException]                                                                                                                                       
  An error occurred when executing the cache:clear --no-warmup command:                                                                                
  Fatal error: Class Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle not found in /Users/x/Desktop/walla/wallabag/app/AppKernel.php on line 43  
  .                                                                                                                                                        


create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]

@j0k3r
Copy link
Member Author

j0k3r commented Feb 8, 2016

Just tried without a problem 😕
Could you send me output of this?

composer --version
php -v

@tcitworld tcitworld reopened this Feb 8, 2016
@0wnrepo
Copy link
Contributor

0wnrepo commented Feb 9, 2016

$ php -v
PHP 5.5.14 (cli) (built: Sep  9 2014 19:09:25) 

Composer version 1.0-dev (9a57de574d6a27896713e83819a6aaf094e256a9) 2016-02-06 15:53:14

@0wnrepo
Copy link
Contributor

0wnrepo commented Feb 9, 2016

installed php 5.6 with brew install homebrew/php/php56

$php -v
PHP 5.6.18 (cli) (built: Feb  6 2016 06:47:15) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

testing right now.. if this doesn't work, i'll try php 7

@0wnrepo
Copy link
Contributor

0wnrepo commented Feb 9, 2016

for php 5.6.18 the initial command succeeds but upon running $php bin/console wallabag:install
it shows the same error :

PHP Fatal error:  Class 'Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle' not found in /Users/ed/Desktop/wally4/wallabag/app/AppKernel.php on line 43

Fatal error: Class 'Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle' not found in /Users/ed/Desktop/wally4/wallabag/app/AppKernel.php on line 43

trying with php 7

@j0k3r
Copy link
Member Author

j0k3r commented Feb 9, 2016

@0wnrepo I got the same error for wallabag:install. You don't need to test on php7, this is a bug :)
Also, I've tried with PHP 5.5.32 and got no problem

So I guess we have a problem, at least, with PHP 5.5.14.

EDIT
Well no it's not a bug, it's a problem in the readme.
Could you try php bin/console wallabag:install --env=prod instead ? Command is launched in dev mode by default

@0wnrepo
Copy link
Contributor

0wnrepo commented Feb 9, 2016

@j0k3r that worked ! sort of with php 5.6.18 :

Installing Wallabag...

Step 1 of 4. Checking system requirements.
+---------+--------+----------------+
| Checked | Status | Recommendation |
+---------+--------+----------------+
| PCRE    | OK!    |                |
| DOM     | OK!    |                |
+---------+--------+----------------+
Success! Your system can run Wallabag properly.

Step 2 of 4. Setting up database.
Creating database and schema, clearing the cache
PHP Warning:  date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/ed/Desktop/wally4/wallabag/vendor/jms/serializer-bundle/JMS/SerializerBundle/DependencyInjection/Configuration.php on line 66

Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/ed/Desktop/wally4/wallabag/vendor/jms/serializer-bundle/JMS/SerializerBundle/DependencyInjection/Configuration.php on line 66

Step 3 of 4. Administration setup.
Would you like to create a new user ? (y/N)y
Username (default: wallabag) :0wnrepo
Password (default: wallabag) :0wnrepo
Email:t@x.com


  [Exception]                                                                                                                                      
  DateTime::__construct(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the d  
  ate_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled t  
  he timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.  
$ php bin/console server:run --env=prod


 [ERROR] Running PHP built-in server in production environment is NOT recommended!                                      



 [OK] Server running on http://127.0.0.1:8000                                                                           


 // Quit the server with CONTROL-C.

upon opening the url in the browser I get :


**
Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/ed/Desktop/wally4/wallabag/vendor/monolog/monolog/src/Monolog/Logger.php on line 272

Fatal error: Uncaught exception 'RuntimeException' with message 'Setting "wallabag_support_url" couldn't be found.' in /Users/ed/Desktop/wally4/wallabag/vendor/craue/config-bundle/Util/Config.php:139 Stack trace: #0 /Users/ed/Desktop/wally4/wallabag/vendor/craue/config-bundle/Util/Config.php(42): Craue\ConfigBundle\Util\Config->createNotFoundException('wallabag_suppor...') #1 /Users/ed/Desktop/wally4/wallabag/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php(72): Craue\ConfigBundle\Util\Config->get('wallabag_suppor...') #2 /Users/ed/Desktop/wally4/wallabag/var/cache/prod/appProdProjectContainer.php(2201): Wallabag\UserBundle\Mailer\AuthCodeMailer->__construct(Object(Swift_Mailer), Object(Twig_Environment), 'no-reply@wallab...', NULL, Object(Craue\ConfigBundle\Util\Config)) #3 /Users/ed/Desktop/wally4/wallabag/var/bootstrap.php.cache(2100): appProdProjectContainer->getWallabagUser_AuthCodeMailerService() #4 /Users/ed/Desktop/wally4/wallabag/var/cache/prod/appProdProjectContainer.php(1571): Symfony\C in /Users/ed/Desktop/wally4/wallabag/vendor/craue/config-bundle/Util/Config.php on line 139

@j0k3r
Copy link
Member Author

j0k3r commented Feb 9, 2016

Yeah that error is quite common in php. You need to define your timezone in php.ini: #1591 (comment)

@0wnrepo
Copy link
Contributor

0wnrepo commented Feb 9, 2016

Fixed the datetime but now I get

Fatal error: Uncaught exception 'RuntimeException' with message 'Setting "wallabag_support_url" couldn't be found.' in /Users/ed/Desktop/wally4/wallabag/vendor/craue/config-bundle/Util/Config.php:139 Stack trace: #0 /Users/ed/Desktop/wally4/wallabag/vendor/craue/config-bundle/Util/Config.php(42): Craue\ConfigBundle\Util\Config->createNotFoundException('wallabag_suppor...') #1 /Users/ed/Desktop/wally4/wallabag/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php(72): Craue\ConfigBundle\Util\Config->get('wallabag_suppor...') #2 /Users/ed/Desktop/wally4/wallabag/var/cache/prod/appProdProjectContainer.php(2201): Wallabag\UserBundle\Mailer\AuthCodeMailer->__construct(Object(Swift_Mailer), Object(Twig_Environment), 'no-reply@wallab...', NULL, Object(Craue\ConfigBundle\Util\Config)) #3 /Users/ed/Desktop/wally4/wallabag/var/bootstrap.php.cache(2100): appProdProjectContainer->getWallabagUser_AuthCodeMailerService() #4 /Users/ed/Desktop/wally4/wallabag/var/cache/prod/appProdProjectContainer.php(1571): Symfony\C in /Users/ed/Desktop/wally4/wallabag/vendor/craue/config-bundle/Util/Config.php on line 139

EDIT installed xdebug for readability

( ! ) Fatal error: Uncaught exception 'RuntimeException' with message 'Setting "wallabag_support_url" couldn't be found.' in /Users/ed/Desktop/wally4/wallabag/vendor/craue/config-bundle/Util/Config.php on line 139
( ! ) RuntimeException: Setting "wallabag_support_url" couldn't be found. in /Users/ed/Desktop/wally4/wallabag/vendor/craue/config-bundle/Util/Config.php on line 139
Call Stack
#   Time    Memory  Function    Location
1   0.0011  235720  {main}( )   .../router_prod.php:0
2   0.0016  243664  require( '/Users/ed/Desktop/wally4/wallabag/web/app.php' )  .../router_prod.php:40
3   0.0251  3612376 Symfony\Component\HttpKernel\Kernel->handle( )  .../app.php:28
4   0.0563  8106536 Symfony\Component\HttpKernel\HttpKernel->handle( )  .../bootstrap.php.cache:2300
5   0.0563  8107488 Symfony\Component\HttpKernel\HttpKernel->handleRaw( )   .../bootstrap.php.cache:2951
6   0.0563  8108184 Symfony\Component\EventDispatcher\EventDispatcher->dispatch( )  .../bootstrap.php.cache:2978
7   0.0563  8108272 Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->getListeners( )    .../EventDispatcher.php:42
8   0.0563  8108464 Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->lazyLoad( )    .../ContainerAwareEventDispatcher.php:127
9   0.3651  22896848    Symfony\Component\DependencyInjection\Container->get( ) .../ContainerAwareEventDispatcher.php:181
( ! ) RuntimeException: Setting "wallabag_support_url" couldn't be found. in /Users/ed/Desktop/wally4/wallabag/vendor/craue/config-bundle/Util/Config.php on line 139
Call Stack
#   Time    Memory  Function    Location
1   0.4006  25049208    Symfony\Component\Debug\ErrorHandler->handleException( )    .../ErrorHandler.php:0

EDIT2 installing wally again with xdebug enabled, will be back in a few minutes

@0wnrepo
Copy link
Contributor

0wnrepo commented Feb 9, 2016

Om my ! This is working !!!

I'll come back with all the steps that I did in order to get it working properly.

  • For Mac OS 10.10.2

EDIT: I love it !! I'm ditching pocket.

@j0k3r
Copy link
Member Author

j0k3r commented Feb 9, 2016

Fatal error: Uncaught exception 'RuntimeException' with message 'Setting "wallabag_support_url" couldn't be found.

This one is strange because the install command should define this key.
Could you check inside the craue_config (or sth similar) table to check if you see that key ?

@0wnrepo
Copy link
Contributor

0wnrepo commented Feb 9, 2016

That may have happened because I accidentally hit delete two times in the console when editing it.
Great job ! Though it's a near turn-off for new users to install so many things / fixing default configurations on mac. + You need a github account + token only to install it.

@j0k3r
Copy link
Member Author

j0k3r commented Feb 9, 2016

token only to install it.

You mean a Github token?

@0wnrepo
Copy link
Contributor

0wnrepo commented Feb 9, 2016

Yes.

@j0k3r
Copy link
Member Author

j0k3r commented Feb 9, 2016

I guess it's because you are not using a real tag but the master version.

EDIT: I love it !! I'm ditching pocket.

👍 ❤️

I'll come back with all the steps that I did in order to get it working properly.

I'll wait for it :)

@0wnrepo
Copy link
Contributor

0wnrepo commented Feb 9, 2016

Mac OS install wallabag from scratch.

1.brew - package manager for OS X

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew update
$ brew install openssl
$ (if needed) brew link openssl
$ brew install homebrew/php/php56

2.composer

curl -sS https://getcomposer.org/installer | sudo -H php -- --install-dir=/usr/local/bin --filename=composer

3.Find the location of the php.ini file

$php --ini

3.1.Edit it and add

date.timezone = "Europe/Paris"

4.restart terminal / add your php installation to the path
5.You need a directory where your wallabag server installation will reside, open that, and run :

$ SYMFONY_ENV=prod php -d memory_limit=-1 /usr/local/bin/composer create-project wallabag/wallabag wallabag "2.x-dev" --no-dev

6.When you are asked for a github token you need to follow these steps :
6.1.Create a github account https://github.com
6.2.In the top-right of the page, go to your account - settings - Personal Access Tokens - Generate new Token.
6.3.Copy/paste that into terminal.
7.You will be prompted with :

Some parameters are missing. Please provide them.
database_driver (pdo_sqlite): 

You can just skip these by hitting enter, but be careful not to skip the important ones like usernames and passwords and security tokens.
You can name your test database as you wish, eg : testdb.

For the port numbers you can set 9000 / 9001 or anything else between 0-65535.
8.For the pocket consumer key (that key is used to retrieve the urls from your account, nothing else) you need to follow the steps from here : http://wallabag.readthedocs.org/en/v2/user/import.html#from-pocket
9.After this is successful, type :

$ cd wallabag 
$ php bin/console wallabag:install --env=prod

9.And finally

$ php bin/console server:run --env=prod

Congratulations, you are using the latest, finest, and most unstable wallabag revision !

@j0k3r should I create a pull request with an updated Readme.md ?

@tcitworld
Copy link
Member

@j0k3r should I create a pull request with an updated Readme.md ?

Not in Readme.md, but it would be fine in the upcoming documentation for v2, in a admin directory. We'll link from Readme.md to there.

Thanks a lot for the HowTo !

@j0k3r
Copy link
Member Author

j0k3r commented Feb 9, 2016

@0wnrepo Thanks a ton for that and for taking time to debug it! 👍
I think we should put that in a troubleshooting section instead of inside the readme.

By the way, the readme still need to be updated about the --env=prod for the install command. Feel free to submit a PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants