Tag Archives: Linux

PHP Composer update command and Status: 404 Not Found on Linux server

Today I was trying to update Cakephp on my remote server using composer. I tried to follow the commands given at https://getcomposer.org/download/ under Command-line installation but it failed at the very first go. The command line code is:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

My server is a CentOS Linux release 7.4.1708 (Core) server with cpanel install. So, running the first command over there gives me the following error:

Error in argument 1, char 2: option not found r

Which clearly indicates the there is no r argument. If we check the above code in detail this is it tries to do:

  1. It tries to read the installer from give url https://getcomposer.org/installer and write it to a file named composer-setup.php
  2. If the file hash matches the given hash it tells user that install is verified otherwise it says that the Installer is corrupt and delets the file from server.
  3. Runs composer-setup.php
  4. Deletes composer-setup.php from server.

After doing all these steps it would let you run the following command in your directory you installed the composer in:

php composer update. However my method failed and then I found that the composer was already installed on my server at location /opt/cpanel/composer/bin. Since it was installed globaly and not under php php composer wont work at all.

Now if I ran composer update, because it was installed in teh given path it woudl show me the follwoing message:

Composer could not find a composer.json file in /opt/cpanel/composer/bin
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ “Getting Started” section

So all I need is to specify the correct path of my working directory. Doing this worked like a charmfor me:

composer update --working-dir /home/myproject/public_html/

Flash player APT “natty-partner” installation issue fixed

For last few days i had struck with installing flash player since i had updated my system (kUbuntu) softwares through it’s “Updates Available” feature. Since then, now and then, i had been trying different things in this regard but eventually could not make flashplayer work and run flash content in any of Google Chrome, Mozilla Firefox and Rekong (included by default in kUbuntu) browsers. Being quite busy with other stuff and perhaps i didn’t feel a desperate need to run flash content in the meantime i had been just ignoring the issue altogether. Continue reading

Gimp Image Editor not launching in KUbuntu – resolved

I recently had installed Gimp image editor in my KUbuntu through software management interface. After the installation was done i clicked the Gimp icon to launch it and the system did seem to try to load it but eventually it failed. However if i tried “gimp” command in “Konsole” it would load it (with a number of “failed” messages in the console window) but when i worked on a image for few seconds it would crash abruptly. Continue reading