Jump to content

docker, wordpress and yaml_parse_file()


Recommended Posts

$ curl http://localhost:8000

The web page shows this thing:

Fatal error: Uncaught Error: Call to undefined function
yaml_parse_file() in /var/www/html/wp-content/plugins/mytest/main.php

Maybe I have to install the php-yaml extension (or something similar).
How you do it?

Here is my docker-compose.yml file:

version: '3.3'

services:
    db:
      image: mysql:5.7
      volumes:
        - dbdata:/var/lib/mysql
      restart: always
      environment:
        MYSQL_ROOT_PASSWORD: somewordpress
        MYSQL_DATABASE: wordpress
        MYSQL_USER: wordpress
        MYSQL_PASSWORD: wordpress

    wordpress:
         container_name: mytestplugin
         depends_on:
             - db
         image: wordpress:latest
         ports:
             - "8000:80"
         restart: always
         environment:
            WORDPRESS_DB_HOST: db:3306
            WORDPRESS_DB_USER: wordpress
            WORDPRESS_DB_PASSWORD: wordpress
         volumes:
             - .:/var/www/html/wp-content/plugins/mytest

volumes:
     dbdata:

 

Link to comment
Share on other sites

I don't see instructions for doing it within Docker already written for you.

Do you understand how Docker images work? What Dockerfiles do? It would not be hard to take the regular installation instructions and port them to a Docker environment.

Link to comment
Share on other sites

30 minutes ago, requinix said:

Non vedo le istruzioni per farlo all'interno di Docker già scritte per te.

Capisci come funzionano le immagini Docker? Cosa fanno i Dockerfile? Non sarebbe difficile prendere le normali istruzioni di installazione e portarle in un ambiente Docker.

I wrote on this forum just because I have this difficulty.
What else are the forums for?

Link to comment
Share on other sites

6 hours ago, block34 said:

I wrote on this forum just because I have this difficulty.
What else are the forums for?

If you don't ask a precise question then you might not get a precise answer.

Do you know exactly which WordPress image you're using? What OS is it based on? Debian does have a "php-yaml" package so if you use that one then you can probably set up your own Dockerfile that FROMs the base WordPress image and apt-installs the php-yaml package.

Link to comment
Share on other sites

$ docker inspect wordpress
[
    {
        "Id": "sha256:ee2256095234b2ecd8ccdd6cb0a90e401461020ffa707323ae08a78a03a44ba7",
        "RepoTags": [
            "wordpress:latest"
        ],
        "RepoDigests": [
            "wordpress@sha256:6f609ebf8518069516df36f0ab504735f8e563c1e303c37eba4902e732fcc6c6"
        ],
        "Parent": "",
        "Comment": "",
        "Created": "2020-07-10T06:33:41.143418206Z",
        "Container": "a283dc2b546a4a43d0c243023641e5142976b5557a8760174f5c667549dd2966",
        "ContainerConfig": {
            "Hostname": "a283dc2b546a",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "80/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "PHPIZE_DEPS=autoconf \t\tdpkg-dev \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tmake \t\tpkg-config \t\tre2c",
                "PHP_INI_DIR=/usr/local/etc/php",
                "APACHE_CONFDIR=/etc/apache2",
                "APACHE_ENVVARS=/etc/apache2/envvars",
                "PHP_EXTRA_BUILD_DEPS=apache2-dev",
                "PHP_EXTRA_CONFIGURE_ARGS=--with-apxs2 --disable-cgi",
                "PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64",
                "PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64",
                "PHP_LDFLAGS=-Wl,-O1 -pie",
                "GPG_KEYS=42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312",
                "PHP_VERSION=7.4.8",
                "PHP_URL=https://www.php.net/distributions/php-7.4.8.tar.xz",
                "PHP_ASC_URL=https://www.php.net/distributions/php-7.4.8.tar.xz.asc",
                "PHP_SHA256=642843890b732e8af01cb661e823ae01472af1402f211c83009c9b3abd073245",
                "PHP_MD5=",
                "WORDPRESS_VERSION=5.4.2",
                "WORDPRESS_SHA1=e5631f812232fbd45d3431783d3db2e0d5670d2d"
            ],
            "Cmd": [
                "/bin/sh",
                "-c",
                "#(nop) ",
                "CMD [\"apache2-foreground\"]"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:5ffac81f7fe38c389bae1d7a7aa526bf0720a896d5721e336fde6efb7c01b24f",
            "Volumes": {
                "/var/www/html": {}
            },
            "WorkingDir": "/var/www/html",
            "Entrypoint": [
                "docker-entrypoint.sh"
            ],
            "OnBuild": null,
            "Labels": {},
            "StopSignal": "SIGWINCH"
        },
        "DockerVersion": "18.09.7",
        "Author": "",
        "Config": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "80/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "PHPIZE_DEPS=autoconf \t\tdpkg-dev \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tmake \t\tpkg-config \t\tre2c",
                "PHP_INI_DIR=/usr/local/etc/php",
                "APACHE_CONFDIR=/etc/apache2",
                "APACHE_ENVVARS=/etc/apache2/envvars",
                "PHP_EXTRA_BUILD_DEPS=apache2-dev",
                "PHP_EXTRA_CONFIGURE_ARGS=--with-apxs2 --disable-cgi",
                "PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64",
                "PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64",
                "PHP_LDFLAGS=-Wl,-O1 -pie",
                "GPG_KEYS=42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312",
                "PHP_VERSION=7.4.8",
                "PHP_URL=https://www.php.net/distributions/php-7.4.8.tar.xz",
                "PHP_ASC_URL=https://www.php.net/distributions/php-7.4.8.tar.xz.asc",
                "PHP_SHA256=642843890b732e8af01cb661e823ae01472af1402f211c83009c9b3abd073245",
                "PHP_MD5=",
                "WORDPRESS_VERSION=5.4.2",
                "WORDPRESS_SHA1=e5631f812232fbd45d3431783d3db2e0d5670d2d"
            ],
            "Cmd": [
                "apache2-foreground"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:5ffac81f7fe38c389bae1d7a7aa526bf0720a896d5721e336fde6efb7c01b24f",
            "Volumes": {
                "/var/www/html": {}
            },
            "WorkingDir": "/var/www/html",
            "Entrypoint": [
                "docker-entrypoint.sh"
            ],
            "OnBuild": null,
            "Labels": null,
            "StopSignal": "SIGWINCH"
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 543432548,
        "VirtualSize": 543432548,
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/47ef7806a2760ff29b3c8df660c9268e9bac7e1b3bd83dd0b8132600e1301e94/diff:/var/lib/docker/overlay2/6d4a03144408dee2e26ec515465aa2655754d44fa5e93a4e123b2d0009940b4e/diff:/var/lib/docker/overlay2/8ed9a1b6d7ce568684bb4538c82fa01154a16b62e36ea90461e9ad0b7b24e528/diff:/var/lib/docker/overlay2/c864d3d253878ba5a8fc16a4cfbb74df94a51e53748ef95d6dbc0aaa65a137ea/diff:/var/lib/docker/overlay2/47681a0d0c92a25dec7f7be93dbc2569e8e5e8f6cb7a47b248ea06b3a5385da2/diff:/var/lib/docker/overlay2/2b2dd981ac7a4f0b97479ff6cd12a2d7641fc8dd15e022421b056e867240dbef/diff:/var/lib/docker/overlay2/25b7d56c2e9956ae4ebdd5ef8ac579ead4bf05b0c3ac2f007af5806253e6c979/diff:/var/lib/docker/overlay2/aec83a0766dfea50975b41eadeab442890bd1474054372a282604759a1e12734/diff:/var/lib/docker/overlay2/30b193faaea5c35488d128361242073dbf11a94d91c734c59eac23d9505854c6/diff:/var/lib/docker/overlay2/5062b8470deb15a95e9f76b1800fd79a558fdb552ca2f7185c2e091d4e5fa45c/diff:/var/lib/docker/overlay2/429a926c1b065b8ae2917977be11e5c4bc3137a20c86e26a7ace12fd2b5ae709/diff:/var/lib/docker/overlay2/9d9a81a63ebf515ac29084a89e740d2548c5d0116c87d0282041ddea1397d580/diff:/var/lib/docker/overlay2/565d41e3f4f8cb2bc0c7275f4d4e896c9a91ec7c67a8496f7ad8cf854df21443/diff:/var/lib/docker/overlay2/5bc40efc3fd125da6357a712fbd45640d2f6ed67914ea8821f0a3135a9042f0c/diff:/var/lib/docker/overlay2/531e0cf1ea72898b306828c82e13c368f68bef8185feca971f0753add420981f/diff:/var/lib/docker/overlay2/96f346a50004527548dbf3dc615ca8e2031a14a538e457de08677d6c1c2f7cf2/diff:/var/lib/docker/overlay2/054d43cf5981fb811f50d97306fa62e576973ef337ee030a5d625813361a29cc/diff:/var/lib/docker/overlay2/05b2ac7c377f338eaa94842c21d28f9636aa9855cfae3b56127f28c88979b3f4/diff:/var/lib/docker/overlay2/29dfacf204214bb7d6f94886349b4fea1e426695c939944412523e348d6ada85/diff",
                "MergedDir": "/var/lib/docker/overlay2/085ba4bfdfd202226e0fe293c2533ebc9d14979839ca780f20f70600c074ef27/merged",
                "UpperDir": "/var/lib/docker/overlay2/085ba4bfdfd202226e0fe293c2533ebc9d14979839ca780f20f70600c074ef27/diff",
                "WorkDir": "/var/lib/docker/overlay2/085ba4bfdfd202226e0fe293c2533ebc9d14979839ca780f20f70600c074ef27/work"
            },
            "Name": "overlay2"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:13cb14c2acd34e45446a50af25cb05095a17624678dbafbcc9e26086547c1d74",
                "sha256:4e53c951cb3be8dd433b04b4baaf5d7e3d28b8769e8ee695f9168b256e85754f",
                "sha256:a5df928da0a7242fe40ea6375f20d8434e1a5b88ad6453c3e4e1196d46a55187",
                "sha256:db497de51efd83c51695b81f35d1e73e3d6d99f645cad9e26777a474abe9f660",
                "sha256:fe216093409999341449fdc24c41bf40e73dd165f1df2e1616de862e6f9400a0",
                "sha256:5be09852131792826711673c0b2ee7abde7d52ada63c74de1c7f812182604106",
                "sha256:32e2a84acc26eaa3a3afaed80376a67c8498ddc6825622ac1c81ed7376741215",
                "sha256:fd0aeb60becb9fa5f74572c6c795dab4ff1a6bd02ca478f12d72fd727d7a7108",
                "sha256:7067740af29d7f41e77753a9df9902b6732a86223f802ab3dc753fd333ada955",
                "sha256:a1648f44ff3c321a85a4adea5559349f965dd5c0c34ba7f4e4e1a4b63052394e",
                "sha256:4798b6ae8fb0f1e184161493e03a048c98d91e3e39a2349743b02f7b1c4e2399",
                "sha256:262bd4bf0478b7d52a44a303a64154a348c4f51707b267b1014e876334e4fef6",
                "sha256:a778111f7b26f54be701dadbee9aa9f74da676c18af720bd654bcde02f965390",
                "sha256:72c7ca9bc95860db8073f923678ec39f484bf58bf55fda1347b765eec33a19a4",
                "sha256:590b1e1167fa3a7c12331c7677cdcf00de64cf4e1b7175092d3e5ecf1a94d926",
                "sha256:073e4123256b47db64a9afbe6f00a27e6bd5fd32ef7d64e381aa89a6c2347ca0",
                "sha256:22926dfe08d4dcfeebd02d4c59948598ee51990ce34f88cf8fdd9ba368bf5ea9",
                "sha256:3aff37ca4cb30ec1f32c21f73a8fab6f2e7446fda26c25686a113a143eb3d8ec",
                "sha256:5b87ef4d56afdd6c841793c471379e9e9682c422f051027326646b581d6d16c6",
                "sha256:dc6cb4512e8a38b27eee484bb627c1f53dbc99ef9c4a9a10498b688b7149a6a1"
            ]
        },
        "Metadata": {
            "LastTagTime": "0001-01-01T00:00:00Z"
        }
    }
]

There are the desired info?

Link to comment
Share on other sites

9 hours ago, requinix said:

Non so abbastanza delle immagini del WP da dire. Non vedo nulla di specifico del sistema operativo lì dentro.

Controlla / etc per eventuali file di "rilascio".

/etc?
However can you tell me exactly the commands to get the information you ask for?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.