Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First draft #1

Merged
merged 12 commits into from
Jul 8, 2020
Merged

First draft #1

merged 12 commits into from
Jul 8, 2020

Conversation

Potherca
Copy link
Member

This MR adds some first-draft documentation and an empty PHP HTTP server (based on several popular PHP packages).

For all intents and purposes,this can be considered version 0.1.0.

@Potherca Potherca requested a review from poef June 30, 2020 15:59
@Potherca Potherca self-assigned this Jun 30, 2020
@michielbdejong
Copy link
Member

michielbdejong commented Jul 1, 2020

With the changes mentioned in https://github.com/potherca-contrib/solid-php/pull/1 I was able to start the Docker container. I didn't see anything on the host system:

loopy:php-solid-server michiel$ curl http://localhost/
curl: (7) Failed to connect to localhost port 80: Connection refused

Then I ran a shell inside the container so that I could see http://localhost/ on the inside, and this is the error I saw:

loopy:php-solid-server michiel$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
3c7f24138c92        php:7.1             "docker-php-entrypoi…"   3 seconds ago       Up 3 seconds                            interesting_lehmann
loopy:php-solid-server michiel$ docker exec -it 3c7f /bin/bash
root@docker-desktop:/# curl http://localhost/
<br />
<b>Warning</b>:  require(/app/web./../vendor/autoload.php): failed to open stream: No such file or directory in <b>/app/web/index.php</b> on line <b>5</b><br />
<br />
<b>Fatal error</b>:  require(): Failed opening required '/app/web./../vendor/autoload.php' (include_path='.:/usr/local/lib/php') in <b>/app/web/index.php</b> on line <b>5</b><br />
root@docker-desktop:/# 

Should I have run composer install --no-dev --prefer-dist on the host system before running the Docker container? If so, can't we do that in a build step of the Docker image?

EDIT: I also tried with the instructions based on the "composer" Docker image, but same result.

@Potherca
Copy link
Member Author

Potherca commented Jul 1, 2020

Ugh. The culprit is /app/web./../vendor/autoload.php. This is a caused by a typo in require __DIR__ . './../vendor/autoload.php';. This should be fixed with my latest commit.

I've also merged you fix for docker 👍

Regarding composer install... I'm not entirely shure what the best way to go is. When I have sorted out a Dockerfile for this repo, it will indeed run composer install as one of the layers. Not entirely sure how/what to do with that in the docs for other solutions. I'll think about that a bit today and update the docs.

@michielbdejong
Copy link
Member

With the composer Docker image, it's possible to run composer install inside the container, and then it will create the vendor folder (apparently running composer serve doesn't create the ../vendor folder?).

@michielbdejong
Copy link
Member

Now, I was able to see 'hello world' :)

Copy link
Member

@michielbdejong michielbdejong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Potherca Potherca merged commit 3046ab1 into pdsinterop:master Jul 8, 2020
@Potherca Potherca deleted the feature/first-draft branch September 12, 2020 09:21
@Potherca Potherca added this to the v0.1.0 milestone Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants