PHP-Composer, locally installed, remote installation need? - composer-php

This is a very simple question and I think that there will be someone who will mark me down for this, but I developed in PHP / CakePHP on my local Ubuntu system, and then install / ftp my code to my hosting company.
With CakePHP which is only PHP code, there is nothing to install, you have to set-up DB connections e.c.t but that is simple stuff but I have just come across PHP Composer, looks very easy to use and install locally.
My question is does it need to be re-installed on my hosting server, e.g once the code / php archive file is loaded into my project and its all working do I need to re-install it via SSH / curl, if so this might not be usable has I would not have access to my server to install it as root but it is only downloading code archive PHP file for use then would this work?
Sorry again for the newbe question but I can not seem to find a simple answer to my question.
Many Thanks
Glenn.

No, you'll be able to run Composer locally and then ftp the result to the target server. This is the preferred setup, because otherwise you'd need a shell on the remote server, or some replacement, and that could mean less security, or it is even impossible with most shared hosting.

Related

Hybrid Composer/FTP Drupal 8 workflow questions

Is it ok to use composer on localhost to upgrade core and modules, and then FTP the files to the server?
I'm on shared hosting, and although it's possible to use SSH with GIT, it's a pain to set up...
Some information about my use case:
No multiple users, no team, no multiple developers, I'm a one man show
Small business sites
I'm the only person adding content
No need for version control, no module development, no coding
I'm a site builder, and the only code I touch are the CSS files of the theme. Will this workflow be ok?
Install Drupal 8 with composer
Import site into aquia dev desktop
Use composer to update modules and core
FTP sites folder to server
Use backup migrate when I alternate working from live to localhost and vice versa
The question is very general and, I think, it has some "conflict" of ideas.
Your question:
Is it ok to use composer on localhost to upgrade core and modules, and then FTP the files to the server
Technically yes. But this method has lots of disadvantages:
DR (Disaster Recovery) - What if you uploaded something that doesn't work? How quickly can you recover? With git its a matter of git checkout
Composer is environment-agnostic - When you run composer install, composer checks some dependencies in you machine and then decides what to install. What if you are missing some required packages in you remote machine? To fix this you should run composer install on the remote machine (via ssh)
FTP might take too long to finish - As apposed to git (or rsync) FTP will upload all files to the server. Other tools will upload just the diff between previous version and the current. So I will always choose rsync over FTP
Security - use SFTP
Your question:
I'm a site builder, and the only code I touch are the CSS files of the theme. Will this workflow be ok
Sounds correct - but remember the composer issue..

composer windows vs ubuntu

Good evening,
This question is has to do with the PHP composer packet management. I have installed in on our test environment (xampp) without any issues and have downloaded the necessary package without any problems (package name: mpdf). After I issue the command to get the package, the vendor package showed up as it should have and my project worked great.
Fast forward, we are not ready to deploy this whole application to a linux(ubuntu 16.04) box using a versioning system (svn) and all the files that were on the test system have been deployed to production. The only problem is that the specific parts of our site on production that needs the mpdf package does not work.
My question is this, even though the vendor folder was also copies to production using SVN, is there anything else for us to do to make this work on the production box?
I am mainly speaking about any necessary steps that might need to performed on the ubuntu box?
Thank for all the help in advance,
George Eivaz
I figured out what the issue was. It had to do with the permissions not being correct on Ubuntu.

Composer portable mode?

help me please:
My case
I have a manually mounted WAMP server using separate packages on drive E:
I did this, so that when I format my computer, I do not have to install it again.
For now everything works very well and little by little I have been making changes in the configurations to make tests.
Today I learned that there is "composer" which allows to manage dependencies for PHP projects.
I downloaded it and installed it (which is very easy).
My question
When formatting my computer and "reactivating" my WAMP, do I need to reinstall composer? Or can I use it as if it were portable?
Composer is just a collection of PHP files, conveniently tied together in one file with the .phar file format (and probably with or without .phar extension). You should be able to either install Composer again, or download that Phar file again if it got lost.

Joomla installation permission errors

So I have been given the task of upgrading one of our companies' old websites that is based on 1.5 to something newer (because a second site of ours on the same version just got hacked).
I know some php and some other web stuff, but I'd never used Joomla.
I have setup a lamp server on a local VM (ubuntu) for me to test it all out on, then upload the upgraded version as is suggested. My problem now is that I know the permissions are not correct because when I tried installing Akeeba Backup, it kept throwing errors such as "could not copy to /var/www/components and /var/www/administrator etc. I went in and chmod'd those 2 (and then the rest of www because of more errors) to 757 (from 755 for the most part) - which i know at that point might as well be 777. Then when I've tried to use Kickstart to restore from the JPA file I have, it just right away throws an error "could not create j_backup/ folder".
I know this slackening of all permissions on the root folder is wrong, but it was the only way to get it to 'work', which it's not even now, so my question is what did I do wrong in the setup and how do i fix it? I'm not great with Linux, but I'm thinking I have to make PHP owner of www? is that right? or terrible practice?
The other issue I see now is that I just installed the latest php and everything and I see Akeepa says not to use php 5.4... not sure how much of a problem that's going to be....
Some direction would be great because I'm more than a little lost.
Thanks!
This is certainly a headache. Most often, as you stated, the issue is the ownership of the files on your server. Files uploaded via FTP will be owned by your FTP user and may not be editable by the Apache/PHP user. Similarly, files created by installing extensions in Joomla! will be owned by the Apache/PHP user and your FTP user will not be able to modify them. Here is an article discussing the problem with a couple of possible solutions:
http://docs.joomla.org/Why_can%27t_you_install_any_extensions%3F#File_ownership_advice_from_ianmac
In the past, I have used an Apache Module called suPHP (http://www.suphp.org/Home.html) to solve this problem and keep it from reoccurring. suPHP executes PHP scripts with the permissions of their owners.
As for file permissions other than ownership, please refer to the Joomla! documentation for the correct settings: http://docs.joomla.org/Verifying_permissions. One quick way to handle this (if you can install extensions after correcting the ownership issue) is to use the AdminTools extension (http://extensions.joomla.org/extensions/access-a-security/site-security/site-protection/14087). One of its tools ‘fixes’ the file permissions on your server by resetting them to the Joomla! default.
Good luck!

how to manually install npm package or node.js with full setup?

I am a php developer. For easy installation of php+apache+mysql there is WAMP, xampp, etc.
my internet connection is bad quality. and unable to use npm install. i want download a single setup file that installs node.js, socket.io, expressjs and etc
I am not aware of any package similar to WAMP for Node.js. Nonetheless, you can grab Node.js Windows installer from here: http://nodejs.org/#download. Please note that the only embedded tool is npm.
If you can not use npm directly, getting all the dependencies will be a real mess. Most of the packages you will need (socket.io and express for example) in turn have multiple dependencies.
Anyway, it is still possible to use npm from manually downloaded files. Look at http://npmjs.org/doc/install.html for more informations.
You can download packages manually at http://search.npmjs.org. There is no single setup that downloads any possible configuration of npm packages, you would have to download them one at a time but that should be able to grab them even on a very slow connection.
The other option would be to grab them directly from their GitHub location since that's where most of them are hosted. You could sync the source using git and then install them. That should also work on a slow connection.

Resources