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.
Related
A little backstory:
I am creating my first Go web app for school. The professor said that I could use Go. I asked him if I could use the latest version, 1.13, rather than the version installed on the server, 1.10, to leverage the module management feature and the updated errors module. He did not say that I was restricted to 1.10 and even gave me the contact information of the server admin. I reached out to the server admin with my professor CC'd and he said he doesn't want to update the server's version of Go in the middle of the semester. He then included instructions on how to download, install, and use whatever version of Go that I need in my home directory.
Pick your version:
https://golang.org/dl/
Set it up for your own use:
https://golang.org/doc/install
I installed go 1.13 and updated my own envvars to reflect this version and everything works.
Well, the other requirement is that I have to hand my professor my project and that it has to compile on the server. I am thinking that if I hand him a bundle and give him directions on how to build it, then I've technically met the requirements of the project so far.
My question is, does Go have anything that takes my Go v1.13 environment and packages everything up so that the project can compile on the target server? I have only been able to find solutions along the lines of "just copy the project binary to your production server" but that doesn't help me. I need it to compile on the production server. Besides, I tried copying my binary to the production server and it couldn't find my html templates (stored in ./ui/html/ directory) but I guess that will be solved in this discussion or saved for another SO question later.
student#universityserver:~$ ./web
INFO 2019/09/22 10:21:52 Starting server on :5089
INFO 2019/09/22 10:23:03 <ipaddress>:63527 - HTTP/1.1 GET /
ERROR 2019/09/22 10:23:03 handlers.go:29: open ./ui/html/home.page.tmpl: no such file or directory
The only thing I can think of right now is to basically add everything they need (the go amd64 binary distribution and all modules) and write a script that handles it all (extract go in local folder, export envvars, build, etc.)
Dear, Professor.
Copy this tarball to your home directory, extract, run build_my_goapp.sh script.
Sincerely,
Your student
The answer in my case was that I can supply a Makefile that does anything I need it to do.
(It's actually good practice, if not an expectation, of a project that is turned in.)
The requirements were that my project needs to compile on the server and that I had to supply a Makefile. Therefore, any downloading, installing, and setting up of a Go environment for my project can be done, as long as everything happens in the user's environment and is not something that needs sudo to install correctly. The server does not have Docker.
I've got a DS718+ serving my development environment, PHP/MySQL on the bundled Nginx. Everything seems to work after lots of messing around except I'm used to a SCSS compiler that detects changes and automatically recompiles. I can't seem to find anything on Synology that does this.
I could do:
A Docker. This requires too much work to maintain and overhead to run.
phpSCSS. I'd have to change my source to serve SCSS and compile on the fly, which breaks my existing dev (and prod) environments.
Local compilation of SCSS. Then my Synology no longer represents a self-contained development environment.
Does anyone have a working solution or a recommendation?
I guess you would like a full-version linux platform like debian on synology. So that you can do whatever you want like you do before on your linux boxes.
I recommend you use debian-chroot on synology.
I have compiled a suite of debian-chroot for DSM6.x on almost synology platforms, you can install it on your DS718+ follows https://github.com/OKit-Scripts-Projects/DSM.Customizations/blob/master/App.Debian-Chroot.md
Once you have a debian-8 on your DS718+, you can do anything like before, such as a self-contained development environment.
If there is any problem, feel free to ask me here or open an issue on my github repo.
Use Synology Client,and create a local folder naming the folder as it appears on the nas on your pc where you will hold the project files. If you create a two way sync the two folder will mirror each other, and any changes will automatically update.
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.
This may be a stupid question but after a fair bit of googling i and still unsure weather i should be removing the the composer.phar file after installation. Is the files just part of the installation or required to run the application ?
The Composer executable is used to manage your dependencies, which is mostly "update" and "install". The result is an autogenerated autoloader and a complete tree of files from the required packages of the application.
The executable itself is not part of the application and therefore is not needed to run it. For security reasons it should not be present on the live servers unless you really know it has to be there, because it seems like a good idea to not give an attacker some useful tools into their hands.
The proper places to have the executable are your development environment (in order to add new packages and update the old ones) and the deployment server that puts the application onto the live server (otherwise you cannot install the packages that your application runs with).
I know that people tend to create a workflow that simply pushes a branch to production, and a post-transmit hook then runs composer install, but this is dangerous from a reliability standpoint: What if Github has an unexpected downtime and you push to production, unable to download the new packages? In this scenario, the server doing the deployment actually is the production server and so requires a copy of the Composer executable, but I explained that this is no ideal setup.
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.