Internal error when trying to use any composer functionality - zend-framework2

I'm using composer in a ZF2 PHP project in Zend Studio 10.6. I recently tried to add a depency to the project, and I received an "internal error". Since then, whenever I try to use any function, I receive the same error:
Error msg
"An internal error occurred during: "Package Details".
For input string: "if (defined('COMPOSER_DEV_WARNING_TIME') && $commandName !== 'self-update' && $commandName !== 'selfupdate' && time() > COMPOSER_DEV_WARNING_TIME""
The search function when I try to add a depency also does no longer find any packages, even though I have a repository installed.
I'm very grateful for any suggestions!

I had the same problem. My solution was to use the composer via the commander.
Make sure you have installed the composer (check by writing "composer -V" in your commander to see your version), then just place your dependency in your composer.json file.
For example:
"require" : {
"php" : ">=5.3.3",
"zendframework/zendframework" : "=2.3.7",
Run the command: "composer update" in your project.
For me this worked.
You can use all composer functions in the commander.
You can find help here if you use Ubuntu: How to install and Use Composer on Ubuntu

I know this is old, but it's a simple fix. This error basically means that ZS/Eclipse cannot find the composer.phar file. Ensure it is referenced properly in your system path, or within the IDE and 'Update Dependencies' will work just fine.

Related

Unable to use rsocket-tcp-client package

I would like to enable client my to reconnect to my server in case the server restarts. I am trying thus the following piece of code. The thing is, after adding this line "rsocket-tcp-client": "^0.0.23" to my package.json and after running $npm install && ng update && ng serve I got the following error message :
Error: ./node_modules/rsocket-tcp-client/build/RSocketTcpClient.js
Module not found: Error: Can't resolve 'net' in '/Users/gitter/myproject/node_modules/rsocket-tcp-client/build'
Error: ./node_modules/rsocket-tcp-client/build/RSocketTcpClient.js
Module not found: Error: Can't resolve 'tls' in '/Users/gitter/myproject/node_modules/rsocket-tcp-client/build'
Any help please will be more than welcome.
You need to install tls and net packages as well if you are going to use that sample code.

error with composer autoload installing phpspreadsheet

I've never used composer before, so I'm not sure what this error means or what I need to do. But I am trying to use PHPSpreadsheet to be able to convert excel files into php for adding information to a database.
Uncaught Exception: Composer autoloader could not be found. Install
dependencies with composer install and try again.
Can anyone tell me what I need to do to get this system working.
Running cPanel with PHP7 EasyApache4
I do have root access to dedicated server.
Looks like you haven't installed the packages via composer.
You have to create a file named "composer.json" on the root of your project.
it should be something like this:
{
"require": {
"phpmailer/phpmailer":"5.2.22",
"slim/slim":"2.0",
"rain/raintpl":"3.0.0",
},
"autoload": {
"psr-4": {
"ProjectName\\": "vendor\\projectPackage\\php-classes\\src"
}
}
}
After that you should run the command "composer install" on you git bash and it will download your dependencies and create an autoload for you.

HYbridauth for facebook login doesn't work

I was trying to configure the hybridauth library so that I can use the the google + and the facebook sign in. But it keeps me giving a fatal error:
Fatal error: require(): Failed opening required 'Facebook\Facebook.php' (include_path='.:/var/www/magilla/lib:/var/www/magilla/models') in /var/www/magilla/lib/RPC/Util.php on line 168
I followed each and every step of their documentation. I have used the
composer to install the library. The library version is 2.9 and the
facebook graph sdk, the most recent version of github
READ EDIT*2 for a proper solution instead
I am encountering the same issue and I suppose you install hybridauth the same way as I did, which is running composer require hybridauth/hybridauth on your project root folder.
I solved this by running composer install within the hybridauth
directory where its composer.json exist, that will install facebook
sdk within the hybridauth directory where the autoload.php is being
load by the script (I personally feel like it is more like a hack than
a proper solution... but I have a feeling that the hybridauth
developer expect you to clone then run the composer install instead of
composer requiring it...I maybe wrong as I just start using composer
as well)
*EDIT check out the issue on their github, there is a bug where the vendor path is being replaced by one in their code, it also mention it is being fixed in later commit. I am new to composer as well so I don't know how to specific the commit for it to update to... if you know how to do it let me know as well
*EDIT*2 alright, I updated to 2.9.3-dev and it seems to solve the issue without generating any new one, I also use that for google and twitter and those are fine too. To update, edit your composer.json to this
"require": {
"hybridauth/hybridauth": "^2.9-dev"
}
then run composer update on your command prompt, things should work as long as you require the composer autoload.php for your script

Can't find (nor make) OAuth php class on Dreamhost VPS

I am trying to configure my Dreamhost VPS (running Debian and PHP5.3) to enable a PHP app to use an OAuth service provided by Autodesk, but the apps keeps failing because it can't find the OAuth class.
I installed the liboauth-php package using aptitude, and restarted the Apache server, but I get a "Fatal error: Class 'OAuth' not found" error.
I researched other pages here on stackoverflow that refer to installing OAuth, PECL and Pear and tried various suggestions I found in other threads, but they have each run into other problems.
I expect that I need to add the following declaration to the php.ini file so that the PHP parser can find the OAuth class, and then put the oauth.so file in the proper directory:
[PHP_OAUTH]
extension=oauth.so
Unfortunately I can't find a oauth.so shared object on the system.
So I thought maybe I could build one using PECL, since the aptitude install of liboauth-php package didn't fix this problem. Unfortunately PECL wasn't installed either. I tried "pear pickle" to install the PECL package but this too failed with this error:
PHP Warning: PHP Startup: Unable to load dynamic library '/imagick.so' - /imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0
Unable to open package2.xml
When that failed, I tried upgrading pear but it also fails with the same error.
PHP Warning: PHP Startup: Unable to load dynamic library '/imagick.so' - /imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0
Unable to open package2.xml
I tried using aptitude to install ndn-php53-imagick, php5-imagick and ndn-phpimagick but the last one failed:
Unpacking ndn-phpimagick (from .../ndn-phpimagick_3.0.1-0_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/ndn-phpimagick_3.0.1-0_amd64.deb (--unpack):
trying to overwrite '/etc/php53/conf.d/imagick.ini', which is also in package ndn-php53-imagick 3.0.1-6
configured to not write apport reports
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/ndn-phpimagick_3.0.1-0_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.
How can I get an oauth.so file or otherwise get the OAuth class recognized by the PHP parser?
The Debian package (as you noticed) does not include oauth.so (I'm not sure why, but it is Debian so could be anything), and I have been unable to find a package for it.
http://bquery.com/blog/post/php_oauth_extension_-_debian_squeeze_installation/
So far thats the only answer I have found. Note that the libpcre-dev might be libpcre3-dev (depends on Debian version), and you will need to install php-pear (php5-pear) to get the pecl command, and php5-dev for pecl to actually work (package dependency hell for just one shared lib).
imagick (ImageMagick) is (should be) unrelated to pear, oauth, pickle, and everything else. Its just an image processing package (resize/rotate/edit images).
After its all installed be sure the extension=oauth.so line is in your php.ini for the proper php (cli vs apache vs ...).

How to install ImageMagick on Windows 7 (2)

Hopefully, despite similar question titles, this isn't a duplicate issue.
I've installed ImageMagick-6.7.5-6-Q16-windows-dll.exe.
I have php_imagick_dyn-Q16.dll renamed to php_imagick.dll in PHP's ext directory.
I have extension=php_imagick.dll in my php.ini.
I try to run a basic test: php -r "var_dump(class_exists('Imagick'));".
I get this error:
PHP Startup: imagick: Unable to initialise module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options must match.
CLI has stopped working.
Windows can check online for a solution to the problem.
> Check online for a solution and close the program
> Close the program
What have I done wrong?
First install :
Link
Download :
http://www.sk89q.com/2010/03/vc6-windows-binaries-for-imagick-2-3-0/
Choose the TS one
Open your php.ini file
Add this line :
extension=php_imagick.dll
Restart your apache server
open php_info()
Now your imagick lib is ready to use.
This works for me.

Resources