Closed adammpkins closed 6 months ago
Seems related to this commit - https://github.com/NativePHP/laravel/commit/6a4357518a93f73bc8a80fb0a69996b8a9e6470b
if (config('nativephp-internal.running')) {
...always seems to be false
+1 on intel mac
Same for all commands in vendor/nativephp/laravel/src/Commands/
On M1 MacBookPro
db:seed also doesn't work
Same as #160.
Please take a look at my comment in https://github.com/NativePHP/laravel/issues/160#issuecomment-1685349569
A workaround which seems to work for me is adding this environment variable
NATIVEPHP_RUNNING=true
+1 on this. Mac Pro M1
+1 for Intel.
The fix is present in the HEAD of https://github.com/NativePHP/electron-plugin (see file) but it is not tagged. The current version of nativephp/electron
package is locked to version 0.2.0 of that plugin. There is a version 0.3.0 of the plugin but the fix was made after that. I can't figure out how to install untagged releases of npm packages so I can't try the latest HEAD release.
It looks like we have to wait for the next version of the plugin and then corresponding updates to the lock file in nativephp/electron
. Meanwhile, I got it working by adding the environment variable manually to php.js in the retrieveNativePHPConfig
function (lines 40-42):
const env = {
NATIVEPHP_STORAGE_PATH: storagePath,
NATIVEPHP_DATABASE_PATH: databaseFile,
NATIVEPHP_RUNNING: true,
};
Same problem on Mac M2
I try to add "NATIVEPHP_RUNNING: true,", without success. Always the same problem.
Error :
Error: Command failed: /Users/***/***/***/nativephptest/vendor/nativephp/electron/resources/js/resources/php/php artisan native:config
at ChildProcess.exithandler (node:child_process:430:12)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1091:16)
at ChildProcess._handle.onexit (node:internal/child_process:302:5) {
code: 255,
killed: false,
signal: null,
cmd: '/Users/***/***/***/nativephptest/vendor/nativephp/electron/resources/js/resources/php/php artisan native:config',
stdout: '\n' +
'Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.2.0". You are running 8.1.17. in /Users/***/***/***/nativephptest/vendor/composer/platform_check.php on line 24\n',
stderr: ''
}
Has there been any progress or workarounds found for this issue? 🙏
It is kind of a deal breaker for experimenting with NativePHP.
'Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.2.0". You are running 8.1.17. in /Users///***/nativephptest/vendor/composer/platform_check.php on line 24\n'
@ThibautPV your issue is different. It seems you've installed your Composer dependencies under PHP8.2 while NativePHP currently uses PHP8.1.
This can be fixed by running composer install
with PHP8.1.
Alternatively, the version of PHP inside NativePHP needs to match your system. More PHP versions are coming soon.
@nickpoulos which issue are you experiencing? There seem to be multiple ones referenced here
Before: Trying to run it on PHP 8.2, I got this same error.
Running it on PHP 8.1 fixes this issue for me.
The issue with the missing NATIVEPHP_RUNNING
environment variable should be solved.
Please update to nativephp/electron v0.6 and try again.
What happened?
When I install a fresh application and require NativePHP, and attempt to bring it up with native:serve, I get an error in the output stating
I see commands for LoadPHPConfigurationCommand and LoadStartupConfigurationCommand but the application doesn't seem to see them.
How to reproduce the bug
Install Laravel via
curl -s "https://laravel.build/NativePHP" | bash
require nativephp via
composer require nativephp/electron
Attempt to bring the application up with
php artisan native:serve
Package Version
0.4.0
PHP Version
8.2.0
Laravel Version
10
Node Version
20.3.1
Which operating systems does with happen with?
Linux
Notes
No response