Why is 'composer update' running so slow when updating a Symfony project on Windows? If I run diagnose everything looks fine, but the update command takes like 25 min or something. Anyone knows whats is going on?
$ composer diagnose
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking composer version: OK
And here are my php module:
$ php -m
[PHP Modules]
apc
apcu
bcmath
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
filter
ftp
gd
gettext
hash
iconv
intl
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
odbc
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib
[Zend Modules]
As you can see Xdebug is not ON. Anyone knows what cause composer to run so slow (while Internet speed is decent)? Are virtual machines (i.e. VirtualBox) with Ubuntu on it + Putty the only solution to this issue?
Ps. Symfony 2.4.10 is not supported by Symfony installer.
Composer is stoping at:
> post-update-cmd: Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile
A thing to improve the version resolve speed is by narrowing down the version constraints yourself. In general, I recommend applications to use pretty narrow version constraints (while packages should use the widest version constraints supported). This especially applies to the symfony/symfony version, as there are many versions.
For instance, assume your composer.json file contains something like this: ~2.3. This will simply resolve to the latest version in the 2.x series, which is 2.8. So you can bypass 100 versions (all 2.3-2.7 releases) by setting your version constraint to ~2.8. The result will be the same.
try
composer config --global repo.packagist composer https://packagist.org
Related
I have installed Lampp on my linux system, and I am learning symfony2, while trying to create the schema with symfony2 command
php app/console doctrine:schema:create
I am getting the following error message:-
PDOException “could not find driver”
I also uncomment this line extension=php_pdo_mysql.dll in php.ini file
I tried to look and google my issue but couldn't resolve my problem. when i run php -m command i am getting the following result:-
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/mysql.so' - /usr/lib/php5/20090626+lfs/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/mysqli.so' - /usr/lib/php5/20090626+lfs/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/pdo_mysql.so' - /usr/lib/php5/20090626+lfs/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mbstring
mhash
openssl
pcntl
pcre
PDO
----
----
Is there a way i can remove this issue ?
In Ubuntu, write in the console
sudo apt-get install php5-gd php5-mysql
and it will work
Hope you are running your project in localhost. In your project folder app/config a file named parameters.ini , Make sure that your Mysql database connection cofiguration is correct. If you are using mysql See database_driver=pdo_mysql is its driver.
Below is an example.
database_driver = pdo_mysql
database_host = localhost
database_port =
database_name = databasename
database_user = msqlusername
database_password = mysqlpassword//if not make blank
mailer_transport = smtp
mailer_host = localhost
mailer_user =
mailer_password =
locale = en
secret = ThisTokenIsNotSoSecretChangeIt
Hope it helps you.
You need to have a module called pdo_mysql.
Look for the following in phpinfo() output,
pdo_mysql => PDO Driver for MySQL, client library version => 5.1.44
to install pdo_mysql you need to do this:
pecl install pdo
pecl install pdo_mysql
and then add the following to your php.ini file:
extension=pdo.so
extension=pdo_mysql.so
brew install php70-pdo-pgsql
in case you installed php7 on mac with brew and, change php version according to what you have installed.
if you are using XAMPP then in php.ini file line no 897(depends on version),
;extension=php_pdo_pgsql.dll
uncomment it , then it appears like below
extension=php_pdo_pgsql.dll
in php.ini file line no 897, then restart XAMPP.
There are two PHP versions installed in my server PHP 5.6 and PHP 7
When I run the command php app/console doctrine:schema:update I have the error : [PDOException] could not find driver
I resolve this error by specifying the PHP version:
php5.6 app/console doctrine:schema:update
Looks like your install is missing the .so files it needs to implement the mysql connection. If you're using a package management system to install PHP then make sure you've installed all the necessary submodules (in this case I think you'll need mysql-dev, and the various PHP PDO modules), though such dependencies should have been resolved for you by the package manager.
If you didn't go through a package manager, then you'll have to compile the required .so files from source.
I had the same problem and for me, it was having multiple PHP versions.
So specifying the full address of the PHP solved the problem.
Adding to Jaspreet Chahal's answer.
When installing PDO as a shared module, the php.ini file needs to be updated so that the PDO extension will be loaded automatically when PHP runs. You will also need to enable any database specific drivers there too; make sure that they are listed after the pdo.so line, as PDO must be initialized before the database-specific extensions can be loaded. If you built PDO and the database-specific extensions statically, you can skip this step(Source).
What I mean is, it should look something like this -
extension=pdo.so should be placed before the extensions of the different database drivers.
Maybe you forget to install doctrine/dbal
composer update
composer require doctrine/dbal
if it didn't work go to your php.ini (according to current version)
and remove ";"
;extension=pdo_mysql.so
** EDIT **
For several cases we need to call Symfony commands on a deployed CloudFoundry app. Symfony commands are php scripts which are called with the PHP CLI.
One example is bin/console doctrine:schema:update (but could be user generation, cache clearing etc.)
So for our app we need both, fpm and cli enabled. This is done with:
"PHP_MODULES": [
"fpm",
"cli"]
in options.json.
After connecting to the app with cf ssh I change to app directory and I call php/bin/php doctrine:schema:update this results in a ClassNotFound: PDO issue.
During staging these commands are called successfully.
I checked that for PHP CLI the PDO extension is not available (by checking php -i) although I have mentioned it in options.json.
"PHP_EXTENSIONS": [
...
"pdo",
"pdo_mysql",
...]
How to enable extensions for CLI and FPM on one app? And is it theoretically possible to have different extensions for CLI and FPM and as well different user-php.ini s to fully/particularly override php.ini of CLI and FPM?
So for our app we need both, fpm and cli enabled. This is done with:
"PHP_MODULES": [ "fpm", "cli"]
in options.json.
This is something that we should probably clean up in the build pack. I do not believe it's (PHP_MODULES) actually used any more.
Maybe a year or more ago, the build pack switched how it downloads PHP. It would previously download individual components modules & extensions. Now it just downloads everything at once. This actually ends up being faster since it's one larger download vs many smaller downloads, and bandwidth is generally very fast for build pack downloads.
Worth mentioning that while PHP_EXTENSIONS no longer triggers what to download it is still used in terms of what extensions get enabled in php.ini. Thus you still need to set that or indicate extensions through composer.
After connecting to the app with cf ssh
I believe that this is the issue. You need to source the build pack env variables so that the env is configured properly.
Ex:
vcap#359b74ff-686c-494e-4a1e-46a9c420f262:~$ php
bash: php: command not found
vcap#359b74ff-686c-494e-4a1e-46a9c420f262:~$ HOME=$HOME/app source app/.profile.d/bp_env_vars.sh
vcap#359b74ff-686c-494e-4a1e-46a9c420f262:~$ php -v
PHP 5.6.26 (cli) (built: Oct 28 2016 22:24:22)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
Staging does this automatically as does runtime for your app. Unfortunately cf ssh does not.
UPDATE:
A slightly easier way to do this is to run cf ssh myapp -t -c "/tmp/lifecycle/launcher /home/vcap/app bash ''". This will open a bash shell and it lets the lifecycle launcher handle sourcing & setting up the environment.
And is it theoretically possible to have different extensions for CLI and FPM and as well different user-php.ini s to fully/particularly override php.ini of CLI and FPM?
Sure. By default, we download and install all extensions. Thus you just need a different php.ini (or some other setting to enable that extension) in which you enable your alternate set of extensions.
When you cf ssh into the container, you could copy the existing php.ini somewhere else and edit it for your CLI needs. Then reference that php-alt.ini when you run your CLI commands.
Never did this but does enabling the php cli in PHP_MODULES (https://docs.developer.swisscom.com/buildpacks/php/gsg-php-config.html) help?
I want to install it.
drupal.org/project/social
But also ssh I get an error.
I installed Composer and Drush.
composer-creator of the project goalgorill / social_templat to: giant-master Dr --no-interaction
I get an error in the command enters the picture.
Composer is telling you exactly what is wrong:
the requested PHP extension bcmath is missing from your system
and how to fix it:
To enable extensions, verify that they are enabled in those ini files
Install and enable the bcmath extension. The exact process will depend on your operating system and how you installed PHP.
After testing clean install of Symfony 2.3 inside vagrant with Ubuntu 12.04.4 and 14.04 like this:
composer create-project symfony/framework-standard-edition login_not_working 2.3.*
update vendors:
composer install
edit app_dev.php like this, on first line after <?php for permissions:
umask(0000); // This will let the permissions be 0777
go to:
http://vagrant.dev/app_dev.php/
i click nice green button with RUN THE DEMO text and try to login with user/userpass or admin/adminpass. Symfony redirects me to:
http://vagrant.dev/app_dev.php/
and in the profiler i see very impressive message You are not authenticated. and with the extremly impressive red button too :D
This is just for testing and in actual application happens the same thing but on different setup... there i am using SonataUserBundle that extends FOSUserBundle...but it behaves the same...
I cleared cookies over, at least, 3 different browsers, clean cache with console and manually,...yada yada...
It smells like something with my vagrant box setup with/or/and a little flavor of permissions or maybe even sessions or ... boy is this kinky or what?
EDIT:
So, i uploaded both apps (clean test and my actual app with SonataUserBundle) to my VPS and both are workin' fine. Still, on few of my vagrant boxes authentication is not working?
And app/check.php output:
$ php app/check.php
OK PHP version must be at least 5.3.3 (5.5.12-2+deb.sury.org~precise+1 installed)
OK PHP version must not be 5.3.16 as Symfony wont work properly with it
OK Vendor libraries must be installed
OK app/cache/ directory must be writable
OK app/logs/ directory must be writable
OK date.timezone setting must be set
OK Configured default timezone "Europe/Berlin" must be supported by your installation of PHP
OK json_encode() must be available
OK session_start() must be available
OK ctype_alpha() must be available
OK token_get_all() must be available
OK simplexml_import_dom() must be available
OK detect_unicode must be disabled in php.ini
OK xdebug.show_exception_trace must be disabled in php.ini
OK xdebug.scream must be disabled in php.ini
OK PCRE extension must be available
** Optional recommendations **
OK xdebug.max_nesting_level should be above 100 in php.ini
OK Requirements file should be up-to-date
OK You should use at least PHP 5.3.4 due to PHP bug #52083 in earlier versions
OK When using annotations you should have at least PHP 5.3.8 due to PHP bug #55156
OK You should not use PHP 5.4.0 due to the PHP bug #61453
OK When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)
OK You should use PHP 5.3.18+ or PHP 5.4.8+ to always get nice error messages for fatal errors in the development environment due to PHP bug #61767/#60909
OK PCRE extension should be at least version 8.0 (8.12 installed)
OK PHP-XML module should be installed
OK mb_strlen() should be available
OK iconv() should be available
OK utf8_decode() should be available
OK posix_isatty() should be available
OK intl extension should be available
OK intl extension should be correctly configured
OK intl ICU version should be at least 4+
OK a PHP accelerator should be installed
OK short_open_tag should be disabled in php.ini
OK magic_quotes_gpc should be disabled in php.ini
OK register_globals should be disabled in php.ini
OK session.auto_start should be disabled in php.ini
OK PDO should be installed
OK PDO should have some drivers installed (currently available: mysql, sqlite)
So, anyway, to answer my own question (kind of) and for the audience...thank you i'm fine... ;)
I configured Symfony to store sessions in memcached and that seems to resolve the problem (kind of). I'll test this on another machine/vagrant to confirm this :D
This "(kinf of)" is whole another story, but i'll leave that for another time :D
EDIT
I tested this on 2 more vagrant boxes and storing sessions to memcached resolve it :)
sorry if this has been answered already, but my searches brought me to nowhere.
I have just installed LAMP environment on Amazon EC2 instance. It runs on:
Ubuntu precise 12.04 amd64 server
PHP Version 5.3.10-1ubuntu3.4
MySQL 5.5.28
Apache/2.2.22 (Ubuntu)
Drupal 7-18
Drupal installation tells me that I have not GD enabled and PDO extension are disabled. However, looking at phpinfo() I have :
GD Support enabled
GD Version 2.0
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.4.8
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPEG Support enabled
libJPEG Version unknown
PNG Support enabled
libPNG Version 1.2.46
WBMP Support enabled
Directive Local Value Master Value
gd.jpeg_ignore_warning 0 0
and
PDO
PDO support enabled
PDO drivers mysql
pdo_mysql
PDO Driver for MySQL enabled
Client API version 5.5.28
Directive Local Value Master Value
pdo_mysql.default_socket /var/run/mysqld/mysqld.sock /var/run/mysqld/mysqld.sock
So, in theory everything must work, why does Drupal not recognize them? I haven't changed anything at all from the clean install of LAMP. May I be missing something then?
Thanks in advance,
maxim
For some reason the problem was solved with reinstalling:
sudo apt-get install --reinstall php5-gd php5-mysql