Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How do I install PHP in the code-server docker container?#7349

Answeredbycode-asher
randrewlove asked this question inQ&A
Discussion options

I installed code-server in a docker container running on my server at https://mydomain.com:8443/. I want to do some development using PHP. I installed the devsense PHP extension (this one). When I try to run or debug a simple PHP file in code-server, a new tab opens at URL https://mydomain.com:8443/proxy/8000/ that only shows the textconnect ECONNREFUSED 0.0.0.0:8000 and back in code-server a popup message in the bottom right mentions that the php binary could not be found or executed and to make sure PHP is installed.

My server has PHP installed, but my current understanding is that I need it installed inside the code-server docker container. I went to the terminal from within code-server and tried to executesudo apt install php in an attempt to install it inside the container, but this was the result:

abc@servername:/config/workspace/php_sandbox# sudo apt install php[sudo] password for abc: Reading package lists... DoneBuilding dependency tree... DoneReading state information... DoneE: Unable to locate package php

I tried searching to find any PHP installation stepsspecific to code-server, but I could not find anything. How is this done?

You must be logged in to vote

We delete all the cached repository lists from the image. From what I understand, this is a common practice in Docker for optimizing layers.

In any case, that means you need to runsudo apt update first to fetch the repositories, then yourinstall should work.

Replies: 1 comment 1 reply

Comment options

We delete all the cached repository lists from the image. From what I understand, this is a common practice in Docker for optimizing layers.

In any case, that means you need to runsudo apt update first to fetch the repositories, then yourinstall should work.

You must be logged in to vote
1 reply
@randrewlove
Comment options

Makes sense. I was able to install after updating. Thanks!

Answer selected byrandrewlove
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@randrewlove@code-asher

[8]ページ先頭

©2009-2025 Movatter.jp