dracoblue.net

Compiling newrelic php agent on mac m1 arm64

According to the arm64 newrelic php page there is arm64 support for the php agent, if it is running Amazon Linux or CentOS Linux8, but not for Apple or M1.

However, when I pulled the latest tar.gz (v10.4.0.316 as of 2023/01/13) at https://github.com/newrelic/newrelic-php-agent/archive/refs/tags/v10.4.0.316.tar.gz and tried to compile - it did nearly work.

The first tries of make agent, will fail with missing pcre_compile or aclocal or glibtoolize. This can be fixed by installing brew install pcre for pcre_compile, brew install automake for aclocal and brew install libtool for glibtoolize.

Then finally running make agent ends up in:

util_hash.c:198:5: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
    case 2:
    ^
util_hash.c:198:5: note: insert '__attribute__((fallthrough));' to silence this warning
    case 2:
    ^
    __attribute__((fallthrough));
util_hash.c:198:5: note: insert 'break;' to avoid fall-through
    case 2:
    ^
    break;
Continue reading ...

In apple, arm, homebrew, newrelic, php by DracoBlue @ 2023-01-14 | 617 Words

Not working precedence of real environment variables in symfony dotenv

When configuring symfony with .env and real environment variables I ran into an interesting issue.

My first test drive of nginx unit (which is nice to not have a php-fpm+nginx docker container, but just one) I setup the php box and noticed that even though the Overriding Section states different, it seemed like my real environment variables did not have precedence in this case.

Continue reading ...

In nginx unit, php, symfony by DracoBlue @ 2022-09-13 | 193 Words

Unix socket in Doctrine DSN

When using the cloud sql proxy especially with cloud run for cloudsql mysql instance connections, these are available as unix sockets like this:

/cloudsql/PROJECT_NAME:REGION_NAME:INSTANCE_NAME

The gcloud documentation says with php pdo (without doctrine) the connection shall be made like this:

$dsn = sprintf(
    'mysql:dbname=%s;unix_socket=%s/%s',
    $dbName,
    $socketDir,
    $connectionName
);

// Connect to the database.
$conn = new PDO($dsn, $username, $password, $conn_config);

But if you set DATABASE_URL for:

doctrine:
    dbal:
        url: '%env(resolve:DATABASE_URL)%'

like this, you will receive:

An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory  
Continue reading ...

In cloudsql, doctrine, gcloud, mysql, php by DracoBlue @ 2022-09-11 | 166 Words

Update DNS Wildcard Certificate with acme.sh in Kubernetes

The official gitlab helm chart for pages does not support a cert manager for *.pages.example.org as this is officially not supported. Thus you have to create the wildcard certificate manually like described in the docs.

So how to update this regulary? I think there are multiple options (using a different tool then cert manager, running a cronjob in k8s doing acme.sh or others), but I choose today: a scheduled pipeline in gitlab.

Continue reading ...

In acme-sh, cert-manager, gitlab, kubernetes, terraform by DracoBlue @ 2022-01-23 | 1218 Words

Error loading key "ssh_host_ed25519_key": invalid format

Today I ran into the problem that a gitlab shell workload was reporting:

Error loading key "ssh_host_ed25519_key": invalid format

The private key looked similiar like this and great at first glance:

  ssh_host_ed25519_key: |
    -----BEGIN OPENSSH PRIVATE KEY-----
    xxxxREDACTEDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxx==
    -----END OPENSSH PRIVATE KEY-----
Continue reading ...

In external-secrets, gcloud, gitlab, kubernetes, terraform by DracoBlue @ 2022-01-06 | 230 Words

Page 2 - Page 3 - Page 4