PHRETS icon indicating copy to clipboard operation
PHRETS copied to clipboard

How to install?

Open nom3d opened this issue 3 years ago • 5 comments

I can not figure out how to install this to my web server. I've looked up composer and did an hour or so of searching but everything requires previous knowledge. Is there a step by step guide? Also, it would be nice to just be able to download the files and not have to mess with the headache of composer and vendor autoload. Thanks!

The current directions are not enough for the novice. It simply says install using composer and then some json code. What do I do?? How do I do it? I've already written a complete mls system for a client that lasted 7 years so I know I'm not a complete dummy! I just rarely use composer and in the past I just recall copy/paste some bash code and send that to the server via shell/putty.

nom3d avatar Aug 15 '20 17:08 nom3d

This package (or library), like most PHP packages, is not something you install on a web server. Most PHP packages are meant to be "installed" in your project, which just means you save the package's files within your project (alongside your other PHP files). Then, you would upload your entire project to your web server.

If you want to, you can bypass Composer by just downloading this package's files. Currently, you'd do that in GitHub by going to the repo's main page and clicking on the green "code" button, then choosing "download zip." However, you'll also need to install all of the other packages that PHRETS requires to run, which would be a difficult task. That's where Composer comes in. It will install all of those packages for you, as well as any packages those packages depend on and so on.

The JSON that's referenced in the README will end up in your composer.json file in the root of your project. Here are the basic steps that might help.

  1. Install Composer (see the Getting Started section of the Composer documentation). I'd recommend installing it globally.
  2. In your terminal, switch to your project's directory.
  3. If you haven't already, initialize Composer using the command composer init (choosing the defaults for each prompt is fine). This will create a composer.json file for you, which is the JSON configuration file that lists all the packages your project needs.
  4. Install PHRETS using the command composer require troydavisson/phrets. PHRETS will now be installed in the vendor directory along with all of the other packages needed to run PHRETS.
  5. Last, you'll want to require the autoload file that Composer provides: require __DIR__ . '/vendor/autoload.php';. This will allow you to use the classes Composer has installed.

Hope that points you in the right direction.

bradroberts avatar Aug 15 '20 19:08 bradroberts

I really wish people would give just a straight download in addition to the whole composer thing. I followed your steps and now I'm getting errors. I don't have all day to try and debug and figure this out. The point of programming is to make our lives easier. The installation notes are too vague assuming you have knowledge of composer. I like the v1 of phrets because it is 1 file that you download, simple and easy. Instead now I'm faced with a wall and not sure how to proceed.

Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error

nom3d avatar Sep 24 '20 15:09 nom3d

Also, I'm not sure what you mean about not installing on a web server? I'm with HawkHost on a shared server. For 7 years I used v1 of phrets and it ran just fine. Is this not recommended? If not a web server then how does it run, on a home computer here? I don't get it. Sorry for my rant!

I've got a sub domain created, all the files above the root directory and using a few cron jobs to fire my scripts each day updating the mls. Is this not the way?

nom3d avatar Sep 24 '20 15:09 nom3d

SOLUTION: So I'm using a shared web server (HawkHost) and this is how I was able to install. Using WinSCP on windows 10, once logged onto my sftp server, I clicked the Open Terminal button Shift + Control + T. Then from there I simply copy and pasted this into the terminal and hit enter. composer require troydavisson/phrets . That's it!

nom3d avatar Sep 26 '20 15:09 nom3d

Straight up download & including is just a very primitive workflow that doesn't take care of dependencies (other libraries that need to be uploaded). Composer is the way to go. You should simply learn how composer works, not ask for other developers to be held back to old school workflows that are just terrible & error prone.

jeffkee avatar Dec 06 '22 22:12 jeffkee