aj-techsoul / electron-4-php Goto Github PK
View Code? Open in Web Editor NEWAn easiest way to use php in electron
License: MIT License
An easiest way to use php in electron
License: MIT License
My question is, I know that it is not possible to use the application with a file generated by Electron Builder Asar, but even in the files generated by the builder, the regular NPM and Yarn commands work, is it possible to install the NPM command line program into the program itself to run the code on any machine using vbs?
Hello, first I congratulate you for that excellent plug-in for electron, I wanted to ask you every time I generated the npm start or I generated the app with electron packager and I open the program two windows exit exactly the same with my program.
In the cmd there are two server runs, it's like if you hit it twice, which I do not do.
hello. I have a problem to build the project. It works fine with npm start so the problem is with the build apparently everything is compile and then when i want to excecute it shows a white screen without errors. Could you help me?. Too I try to use electron-builder with nsis and the result is the same.
Has anyone tried to build his project and
got good results?.
I am use win10 , electron v10.1.3, node v12.18.0
Hi.
I'm testing this application for the Electron framework and I liked it a lot.
I wanted to know if it is possible to use ELECTRON-4-PHP to carry out a project with commercial purpose.
Thank you.
H,
This repo has been very useful to my project, thank you. I am trying to develop an application. The PHP application I'm trying to develop needs to use NFC card reading and writing. Can I access NFC card reading and writing with PHP?
When I try to run 'npm run package-win' or any of the othres, I get the error,
cannot read propertie of undefined (reading 'info')
full output:
[email protected] package-win
electron-packager . electron-tutorial-app --overwrite --no-asar --platform=win32 --arch=ia32 --icon=icons/logo.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName="Electron Tutorial App"
Packaging app for platform win32 ia32 using electron v22.0.0
Cannot read properties of undefined (reading 'info')
This was working for me last night, but I came back in the morning and now it isn't. Why?
Hi all,
Has anyone had an issue with a lack of scrolling ability in the BrowserWindow()? I cannot get mine to scroll.
Here is my browser window section:
mainWindow = new BrowserWindow({
width: 1024,
height: 768,
contentIsolation: false,
scrollBounce: true,
nodeIntegration: true,
webPreferences: {
blinkFeatures: 'OverlayScrollbars'
},
frame: true,
minWidth: 1024,
minHeight: 768
});
I don't use patreon, but I use github sponsors. I would sign up if you added it.
Hello AJ-Tech i have followed all the steps recommended in these but when i run the script it displayed nothing
How can I do if i want to use the app with an online PHP server on a WebHost ?
What can i put in the PHP.exe location ?
witch port can i use ?
When trying to package the app using
npm run package-win
It throws an error in the console
CANNOT RUN WITH NODE 10.16.3 Electron Packager requires Node 4.0 or above.
hello, I want to know if it's normal that when I use "npm start" it open the app and also the folder where there is the php file ?
Hello ..
When write " npm start " into project folder this error appears " PHP server not started. Retrying... ".
Thanks
Hello,
Such a nice initiative, I really like the idea!
I used electron-builder to pack the electron app. From CLI it was working, but after packing, it just shows blank white screen. Following are the steps to reproduce the problem -
I think I'm doing something wrong or is it just that electron-builder won't pack this properly? As for you, what do you use to pack the application?
i build laravel app with this but my scss not working .like drop drown menu and some this like that how to resolve this.
Hello. Copy and paste doesn't seem to work. I've read that you need to enable it with Electron, but I was thinking most people will probably want it on by default with your project.
Thank you!
Well i tried alot on you php electron just dont want to get started
So I have a better version here https://github.com/MEGAMINDMK/PHP-Electronjs
PHP Server error { Error: spawn php ENOENT
at exports._errnoException (util.js:1024:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19)
at onErrorNT (internal/child_process.js:374:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'spawn php',
path: 'php',
spawnargs:
[ '-S',
'127.0.0.1:80',
'-d',
'display_errors=1',
'-d',
'expose_php=0' ] }
PHP Server closed
Directory permission checked and UAC is off..
Hey there!
My project worked just fine when running it off "npm run start" ("electron ."). I compiled my website for MacOS, but when I tried to open the app I got a blank white page. Seeking more information, I opened developer tools and Chromium gave me the following yellow error:
[Deprecation] The website requested a subresource from a network that it could only access because of its users' privileged network position. These requests expose non-public devices and servers to the internet, increasing the risk of a cross-site request forgery (CSRF) attack, and/or information leakage. To mitigate these risks, Chrome deprecates requests to non-public subresources when initiated from non-secure contexts, and will start blocking them in Chrome 92 (July 2021). See https://chromestatus.com/feature/5436853517811712 for more details.
I have php installed globally and the project worked just fine on windows. Why isn't is working here?
Thanks!
when i build it shows only black screen.. please give solution for building steps
Greetings, awesome project! Have been wanting to learn more about electron, especially with PHP.
I have installed using GIT and can start (npm start) but showing "PHP server not started. Retrying..."
Running Windows 10. Here is my config:
const PHPServer = require('php-server-manager');
const server = new PHPServer({
port: 5555,
directory: __dirname,
directives: {
display_errors: 0,
expose_php: 0
}
});
server.run();
Sure it is something I do not understand about configuring main.js
Could you give me example of what you have working for Windows?
Thanks!
Is it possible to pass PHP variables to the Main.JS process?
Hi there,
ELECTRON-4-PHP is really good !
but just how can we acess to our online PHP version ?
actualy the php is in local, should we keep it or get an online php from a web server ?
laravel 8 can't run using this, because laravel only runs on php version 7.4 and above, can you develop with different php version releases
when I trying to build by (npm install electron-packager) command .exe the file generated successfully but there is an issue that my all data has been removed and shown as blank fields and I unable to see any PHP response. please help me. how can i solve this.
Weeks ago I was looking at the project, and I noticed that it was in PHP version 7.0. I cloned the repository and updated it to PHP 8.1, if you want I can upload the update I made, but you will need access as a project contributor to make the pull requests.
I have seen this video ( https://youtu.be/HwRAaywZXAQ ).
Testing in window 10.
step by step. I follow him but there is no response after run npm start cloud you pleas help me to run this.
EDIT: There is solved, there is a new issue below. I left this here just for documentation if others have the same problem
Hey there!
I used this repository for windows, and it worked just fine. However, when I transferred the files to MacOS to build for mac, I got a strange error. The log is below:
npm run start
[email protected] start
electron .
PHP Server error Error: spawn php/php.exe EACCES
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -13,
code: 'EACCES',
syscall: 'spawn php/php.exe',
path: 'php/php.exe',
spawnargs: [
'-S',
'127.0.0.1:5000',
'-t',
'/Users/pheros/Desktop/Scouting-App',
'-d',
'display_errors=1',
'-d',
'expose_php=1'
]
}
PHP Server closed
This is my php server declaration:
server = new PHPServer({
php: "php/php.exe",
port: 5000,
directory: __dirname,
directives: {
display_errors: 1,
expose_php: 1
}
});
I've seen other people fix their problems with adding that php: "php/php.exe" line, but that didn't solve it for me clearly. How can I fix this error?
Hi, when I use npm start
, the php server doesn't start (I'm on linux so I can't run the .bat)
Any idea ?
update : I fix it
Is it possible to add additional PHP extensions?
So what possible use case on this earth would require this and do you realize the performance bottleneck doing this would cause? Electron is a wrapper for javascript applications to run as desktop applications... NOT A THING YOU SHOULD BUTCHER PHP INTO!!!
I want to use source guardian to encrypt my source code of the project and I need to add a special extension, I add this to php.ini and copy extension to ext folder but it doesn't work
in the tutorial of source guardian we need to change php.ini of apache but here I can't find any way to add and run this extension for ELECTORN4PHP
I have the same error than sheerazahmadpk, the console display PHP server not started. Retrying...
I need help
thanks.
Error: spawn open ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:477:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn open',
path: 'open',
spawnargs: [
'-dxdebug.start_with_request=yes',
'e:\FILES\Desktop\Lab 8.php'
]
}
Im just running the php file then this appears
Hello. Love this project! I've got it working great when I type npm start on OSX, but when I package it into an app, by moving the files into the app folder within the .app, the app launches the window and says "Not Found - The requested resource /index.php was not found on the server". Any idea what's wrong? Or do you have any directions on how to package into an app properly? Thank you so much!
Hello,
Thanks for writing this module. I'm running this on OS X and I can't seem to be able to write to a file using PHP. I can read successfully, however. Here is my write function:
$path = check_path($dir.$file); if (!is_dir($path)) { $content = file_get_contents('php://input'); file_put_contents($path, $content); echo "1"; } else { echo "0"; } exit();
This works fine on Apache/PHP through a browser, but not in Electron.
Does file_put_contents work for you?
Any thoughts on how I can troubleshoot this?
Thanks again,
Andrey
Hello, I used almost all the methods to make an installer. Inno Setup makes an Installer but it places all the files and folders in the installation location. Release-builds folder contains the exe also have the resources folder in which all the php code resides. I don't want to share my code with anyone so that's why I want to make an Installer that hides the code while installing the app.
Please write a guide how to get this work on windows. Tia
Hello again! I've made a program with PHP that outputs progress to the browser (and updates a progress bar via JS) while it executes. It can take some time time to finish, so it's important to see the progress while it executes. I use flush() in PHP after each echo, and in the browser, it works as I intended. Using ELECTRON-4-PHP, I can only see the output after execution finishes. Do you know if there's a way to see progress as it executes using ELECTRON-4-PHP? Thank you!
Like in title. I dont wanna se in realese app clean php code. Cuz there are some data like MySql password and more
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.