Skip to content

cacert.pem not detected using custom PHP binaries #655

@finchy70

Description

@finchy70

What were you trying to do?

I have been developing a desktops Native PHP ass for a few week. This morning I updated to NativePHP v1.1.1 and now I can no longer run 'composer native:dev'.

I have followed the debugging steps in the docs and I am unable to fix the issue.

My composer is as follows

"require": {
        "php": "^8.4",
        "laravel/framework": "^12.0",
        "laravel/tinker": "^2.10.1",
        "league/csv": "^9.23.0",
        "livewire/flux": "^2.1",
        "livewire/flux-pro": "^2.1",
        "livewire/livewire": "*",
        "nativephp/electron": "^1.1",
        "php-flasher/flasher-laravel": "^2.1",
        "symfony/console": "^7.0"
    },
    "require-dev": {
        "fakerphp/faker": "^1.23",
        "laravel/pail": "^1.2.2",
        "laravel/pint": "^1.13",
        "laravel/sail": "^1.41",
        "mockery/mockery": "^1.6",
        "nunomaduro/collision": "^8.6",
        "pestphp/pest": "^3.8",
        "pestphp/pest-plugin-laravel": "^3.2"
    },

When I run 'composer native:dev -vvv' I get this output.
$ composer native:dev -vvv
Reading ./composer.json (C:\Users\Paul\Herd\NativePayroll\composer.json)
Loading config file C:/Users/Paul/AppData/Roaming/Composer/auth.json
Loading config file ./composer.json (C:\Users\Paul\Herd\NativePayroll\composer.json)
Checked CA file C:\Users\Paul.config\herd\config\php\cacert.pem: valid
Executing command (C:\Users\Paul\Herd\NativePayroll): git branch -a --no-color --no-abbrev -v
Executing async command (C:\Users\Paul\Herd\NativePayroll): git rev-list main..dev
Executing async command (C:\Users\Paul\Herd\NativePayroll): git rev-list remotes/origin/main..dev
Failed to initialize global composer: Composer could not find the config file: C:/Users/Paul/AppData/Roaming/Composer/composer.json

Reading C:\Users\Paul\Herd\NativePayroll/vendor/composer/installed.json (C:\Users\Paul\Herd\NativePayroll\vendor\composer\installed.json)
Loading plugin Pest\Plugin\Manager (from pestphp/pest-plugin)
Running 2.8.9 (2025-05-13 14:01:37) with PHP 8.4.8 on Windows NT / 10.0

native:dev: Composer\Config::disableProcessTimeout
native:dev: npx concurrently -k -c "#93c5fd,#c4b5fd" "php artisan native:serve --no-interaction" "npm run dev" --names=app,vite
Executing command (CWD): npx concurrently -k -c "#93c5fd,#c4b5fd" "php artisan native:serve --no-interaction" "npm run dev" --names=app,vite
[vite]
[vite] > dev
[vite] > vite
[vite]
[app]
[app] Starting NativePHP dev server...
[app]
[app] Fetching latest dependencies...
[app]
[app] Installing NPM dependencies (This may take a while)...
[app]
[app] Installing NPM dependencies using the npm package manager...
[app]
[app] Fetching latest dependencies...
[app]
[vite]
[vite] VITE v6.3.5 ready in 279 ms
[vite]
[vite] ➜ Local: http://localhost:5173/
[vite] ➜ Network: use --host to expose
[vite]
[vite] LARAVEL v12.20.0 plugin v1.3.0
[vite]
[vite] ➜ APP_URL: http://NativePayroll.test
[app] npm warn skipping integrity check for git dependency ssh://git@github.com/electron/node-gyp.git
[app] npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
[app] npm warn deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
[app] npm warn deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
[app] npm warn deprecated @babel/plugin-proposal-export-namespace-from@7.18.9: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.
[app] npm warn deprecated lodash.isequal@4.5.0: This package is deprecated. Use require('node:util').isDeepStrictEqual instead.
[app] npm warn deprecated rimraf@2.6.3: Rimraf versions prior to v4 are no longer supported
[app] npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
[app] npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
[app] npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
[app] npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
[app] npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
[app] npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
[app] npm warn deprecated boolean@3.2.0: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
[app]
[app] > NativePHP@1.0.0 postinstall
[app] > node ./node_modules/electron-builder/cli.js install-app-deps
[app]
[app] • electron-builder version=26.0.15
[app] • loaded configuration file=C:\Users\Paul\Herd\NativePayroll\vendor\nativephp\electron\resources\js\electron-builder.js
[app] • executing @electron/rebuild electronVersion=32.3.3 arch=x64 buildFromSource=false appDir=./
[app] • installing native dependencies arch=x64
[app] • completed installing native dependencies
[app]
[app] added 1003 packages, and audited 1004 packages in 8s
[app]
[app] 188 packages are looking for funding
[app] run npm fund for details
[app]
[app] 3 vulnerabilities (1 low, 2 high)
[app]
[app] To address issues that do not require attention, run:
[app] npm audit fix
[app]
[app] To address all issues (including breaking changes), run:
[app] npm audit fix --force
[app]
[app] Run npm audit for details.
[app]
[app] Starting NativePHP app
[app]
[app] Copying latest CA Certificate...
[app]
[app] CA Certificate not found at C:/Users/Paul/Herd/NativePayroll/cacert.pem. Skipping copy.
[app]
[app] Running the dev script with npm...
[app]
[app] Fetching latest dependencies...
[app]
[app]
[app] > eps-payroll-dev@1.0.0 dev
[app] > cross-env node php.js && electron-vite dev --watch
[app]
[app] Binary Source: C:\Users\Paul\Herd\NativePayroll\bin\win\x64\php-8.4.zip
[app] Binary Filename: php.exe
[app] PHP version: 8.4
[app] Unzipping PHP binary from C:\Users\Paul\Herd\NativePayroll\bin\win\x64\php-8.4.zip to C:\Users\Paul\Herd\NativePayroll\vendor\nativephp\electron\resources\js\resources\php
[app] Copied PHP binary to C:\Users\Paul\Herd\NativePayroll\vendor\nativephp\electron\resources\js\resources\php\php.exe
[app] vite v6.3.5 building SSR bundle for development...
[app]
[app] watching for file changes...
[app]
[app] build started...
[app] transforming...
[app] ✓ 2 modules transformed.
[app]
[app] build the electron main process successfully
[app]
[app] -----
[app]
[app] vite v6.3.5 building SSR bundle for development...
[app]
[app] watching for file changes...
[app]
[app] build started...
[app] transforming...
[app] ✓ 1 modules transformed.
[app] rendering chunks...
[app] out/preload/index.mjs 0.17 kB
[app] built in 32ms.
[app]
[app] build the electron preload files successfully
[app] renderer config is missing
[app] Could not resolve "../../resources/cacert.pem?asset&asarUnpack" from "src/main/index.js"
[app] file: C:/Users/Paul/Herd/NativePayroll/vendor/nativephp/electron/resources/js/src/main/index.js
[app] error during start dev server and electron app:
[app] Error: No electron app entry file found: C:\Users\Paul\Herd\NativePayroll\vendor\nativephp\electron\resources\js\out\main\index.js
[app] at ensureElectronEntryFile (file:///C:/Users/Paul/Herd/NativePayroll/vendor/nativephp/electron/resources/js/node_modules/electron-vite/dist/chunks/lib-DyJQBCfr.mjs:90:23)
[app] at startElectron (file:///C:/Users/Paul/Herd/NativePayroll/vendor/nativephp/electron/resources/js/node_modules/electron-vite/dist/chunks/lib-DyJQBCfr.mjs:204:5)
[app] at createServer (file:///C:/Users/Paul/Herd/NativePayroll/vendor/nativephp/electron/resources/js/node_modules/electron-vite/dist/chunks/lib-PoOhNRXw.mjs:74:14)
[app] at async CAC.
(file:///C:/Users/Paul/Herd/NativePayroll/vendor/nativephp/electron/resources/js/node_modules/electron-vite/dist/cli.mjs:67:9)
[app] php artisan native:serve --no-interaction exited with code 0
--> Sending SIGTERM to other processes..
[vite] npm run dev exited with code 1
Script npx concurrently -k -c "#93c5fd,#c4b5fd" "php artisan native:serve --no-interaction" "npm run dev" --names=app,vite handling the native:dev event returned with error code 1

I am using a custom php binary as I need to connect to a mysql db and this has been working fine.

What happened?

When I run 'composer native:dev' the application no longer runs but returns an error.

$ composer native:dev -vvv
Reading ./composer.json (C:\Users\Paul\Herd\NativePayroll\composer.json)
Loading config file C:/Users/Paul/AppData/Roaming/Composer/auth.json
Loading config file ./composer.json (C:\Users\Paul\Herd\NativePayroll\composer.json)
Checked CA file C:\Users\Paul.config\herd\config\php\cacert.pem: valid
Executing command (C:\Users\Paul\Herd\NativePayroll): git branch -a --no-color --no-abbrev -v
Executing async command (C:\Users\Paul\Herd\NativePayroll): git rev-list main..dev
Executing async command (C:\Users\Paul\Herd\NativePayroll): git rev-list remotes/origin/main..dev
Failed to initialize global composer: Composer could not find the config file: C:/Users/Paul/AppData/Roaming/Composer/composer.json

Reading C:\Users\Paul\Herd\NativePayroll/vendor/composer/installed.json (C:\Users\Paul\Herd\NativePayroll\vendor\composer\installed.json)
Loading plugin Pest\Plugin\Manager (from pestphp/pest-plugin)
Running 2.8.9 (2025-05-13 14:01:37) with PHP 8.4.8 on Windows NT / 10.0

native:dev: Composer\Config::disableProcessTimeout
native:dev: npx concurrently -k -c "#93c5fd,#c4b5fd" "php artisan native:serve --no-interaction" "npm run dev" --names=app,vite
Executing command (CWD): npx concurrently -k -c "#93c5fd,#c4b5fd" "php artisan native:serve --no-interaction" "npm run dev" --names=app,vite
[vite]
[vite] > dev
[vite] > vite
[vite]
[app]
[app] Starting NativePHP dev server...
[app]
[app] Fetching latest dependencies...
[app]
[app] Installing NPM dependencies (This may take a while)...
[app]
[app] Installing NPM dependencies using the npm package manager...
[app]
[app] Fetching latest dependencies...
[app]
[vite]
[vite] VITE v6.3.5 ready in 279 ms
[vite]
[vite] ➜ Local: http://localhost:5173/
[vite] ➜ Network: use --host to expose
[vite]
[vite] LARAVEL v12.20.0 plugin v1.3.0
[vite]
[vite] ➜ APP_URL: http://NativePayroll.test
[app] npm warn skipping integrity check for git dependency ssh://git@github.com/electron/node-gyp.git
[app] npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
[app] npm warn deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
[app] npm warn deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
[app] npm warn deprecated @babel/plugin-proposal-export-namespace-from@7.18.9: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.
[app] npm warn deprecated lodash.isequal@4.5.0: This package is deprecated. Use require('node:util').isDeepStrictEqual instead.
[app] npm warn deprecated rimraf@2.6.3: Rimraf versions prior to v4 are no longer supported
[app] npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
[app] npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
[app] npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
[app] npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
[app] npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
[app] npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
[app] npm warn deprecated boolean@3.2.0: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
[app]
[app] > NativePHP@1.0.0 postinstall
[app] > node ./node_modules/electron-builder/cli.js install-app-deps
[app]
[app] • electron-builder version=26.0.15
[app] • loaded configuration file=C:\Users\Paul\Herd\NativePayroll\vendor\nativephp\electron\resources\js\electron-builder.js
[app] • executing @electron/rebuild electronVersion=32.3.3 arch=x64 buildFromSource=false appDir=./
[app] • installing native dependencies arch=x64
[app] • completed installing native dependencies
[app]
[app] added 1003 packages, and audited 1004 packages in 8s
[app]
[app] 188 packages are looking for funding
[app] run npm fund for details
[app]
[app] 3 vulnerabilities (1 low, 2 high)
[app]
[app] To address issues that do not require attention, run:
[app] npm audit fix
[app]
[app] To address all issues (including breaking changes), run:
[app] npm audit fix --force
[app]
[app] Run npm audit for details.
[app]
[app] Starting NativePHP app
[app]
[app] Copying latest CA Certificate...
[app]
[app] CA Certificate not found at C:/Users/Paul/Herd/NativePayroll/cacert.pem. Skipping copy.
[app]
[app] Running the dev script with npm...
[app]
[app] Fetching latest dependencies...
[app]
[app]
[app] > eps-payroll-dev@1.0.0 dev
[app] > cross-env node php.js && electron-vite dev --watch
[app]
[app] Binary Source: C:\Users\Paul\Herd\NativePayroll\bin\win\x64\php-8.4.zip
[app] Binary Filename: php.exe
[app] PHP version: 8.4
[app] Unzipping PHP binary from C:\Users\Paul\Herd\NativePayroll\bin\win\x64\php-8.4.zip to C:\Users\Paul\Herd\NativePayroll\vendor\nativephp\electron\resources\js\resources\php
[app] Copied PHP binary to C:\Users\Paul\Herd\NativePayroll\vendor\nativephp\electron\resources\js\resources\php\php.exe
[app] vite v6.3.5 building SSR bundle for development...
[app]
[app] watching for file changes...
[app]
[app] build started...
[app] transforming...
[app] ✓ 2 modules transformed.
[app]
[app] build the electron main process successfully
[app]
[app] -----
[app]
[app] vite v6.3.5 building SSR bundle for development...
[app]
[app] watching for file changes...
[app]
[app] build started...
[app] transforming...
[app] ✓ 1 modules transformed.
[app] rendering chunks...
[app] out/preload/index.mjs 0.17 kB
[app] built in 32ms.
[app]
[app] build the electron preload files successfully
[app] renderer config is missing
[app] Could not resolve "../../resources/cacert.pem?asset&asarUnpack" from "src/main/index.js"
[app] file: C:/Users/Paul/Herd/NativePayroll/vendor/nativephp/electron/resources/js/src/main/index.js
[app] error during start dev server and electron app:
[app] Error: No electron app entry file found: C:\Users\Paul\Herd\NativePayroll\vendor\nativephp\electron\resources\js\out\main\index.js
[app] at ensureElectronEntryFile (file:///C:/Users/Paul/Herd/NativePayroll/vendor/nativephp/electron/resources/js/node_modules/electron-vite/dist/chunks/lib-DyJQBCfr.mjs:90:23)
[app] at startElectron (file:///C:/Users/Paul/Herd/NativePayroll/vendor/nativephp/electron/resources/js/node_modules/electron-vite/dist/chunks/lib-DyJQBCfr.mjs:204:5)
[app] at createServer (file:///C:/Users/Paul/Herd/NativePayroll/vendor/nativephp/electron/resources/js/node_modules/electron-vite/dist/chunks/lib-PoOhNRXw.mjs:74:14)
[app] at async CAC.
(file:///C:/Users/Paul/Herd/NativePayroll/vendor/nativephp/electron/resources/js/node_modules/electron-vite/dist/cli.mjs:67:9)
[app] php artisan native:serve --no-interaction exited with code 0
--> Sending SIGTERM to other processes..
[vite] npm run dev exited with code 1
Script npx concurrently -k -c "#93c5fd,#c4b5fd" "php artisan native:serve --no-interaction" "npm run dev" --names=app,vite handling the native:dev event returned with error code 1

How to reproduce the bug

The error occurred after running composer update and upgrading to NativePHP 1.1.1.

Debug Output

"{ Environment : { PHP : { Version : 8.4.8 , Path : C:\Users\Paul\.config\herd\bin\php84\php.exe }, Laravel : { Version : 12.20.0 , ConfigCached : false, RoutesCached : false, DebugEnabled : true }, Node : { Version : v24.2.0 , Path : C:\Program Files\nodejs\node.exe }, NPM : { Version : 11.3.0 , Path : C:\Program Files\nodejs\npm\r\nC:\Program Files\nodejs\npm.cmd }, OperatingSystem : WINNT }, NativePHP : { Versions : { nativephp/electron : 1.1.1.0 , nativephp/laravel : 1.1.2.0 , nativephp/php-bin : 1.0.3.0 }, Configuration : { Provider : App\Providers\NativeAppServiceProvider , BuildHooks : { Pre : [], Post : [] }, NotarizationEnabled : false, CustomPHPBinary : / } } }"

Which operating systems have you seen this occur on?

Windows 11 pro

Notes

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions