dracoblue.net

VSCode 100% CPU Usage with WSL1

When I am using windows for development reasons in combination with wsl it is usually pretty good experience. As long as you don't try to mount a windows directory into the linux subsystem, but use the storage directly there - it's nice!

The official vscode extension for wsl usually integrates nicely with visual code.

But today I experienced a very bad performance of vscode and the windows system. A short htop / taskmanager call showed: All CPUs have been in use for 100%. The process eating all resource was called: .vscode-server.

Continue reading ...

In nodejs, vscode, windows, wsl by DracoBlue @ 22 Feb 2023 | 278 Words

Make symfony dotenv use putenv

The other day a friend of mine was using google-auth-library-php in combination with google-cloud-php-pubsub and wanted to set the path for the google credentials file via GOOGLE_APPLICATION_CREDENTIALS in .env.

So we figured that this did not work anymore in the newer version of dotenv (see commit in 4.3) the default value for use_putenv changed to false. And in symfony 5 there was a breaking change to switch use_putenv from true to false (see the putenv deprecation pull request.

Continue reading ...

In dotenv, gcloud, php, symfony by DracoBlue @ 16 Jan 2023 | 236 Words

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 @ 14 Jan 2023 | 655 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 @ 13 Sep 2022 | 198 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 @ 11 Sep 2022 | 201 Words

Page 1 - Page 2

Give something back

Were my blog posts useful to you? If you want to give back, support one of these charities, too!

Report hate in social media Campact e.V. With our technology and your help, we protect the oceans from plastic waste. Gesellschaft fur Freiheitsrechte e. V. The civil eye in the mediterranean

Recent Dev-Articles

Read recently

Recent Files

About