Create your first Desktop Application with PHP and PHP Desktop



Daniel Atakpa Since Jun 17, 2015 5 Posts

@Zooboole, I get the following error message each time I click on phpdesktop-chrome

There is no disk in the drive. Please insert a disk into drive \Device\Harddisk1\DR1. Options: Cancel, Try Again, Continue

What I wanted is for the program to display the content of the index.php file in the www folder. If I click on Continue, the content "Hello World" displays fine. I initially thought that would not be a problem. I went on with the tutorial to compile the app with the Inno Setup Compiler but the end result wouldnt execute. The error message has been phpdesktop-chrome has stopped working. I need you to point me in the right direction please. Thank you.

zooboole Since Jan 22, 2015 112 Posts

Can you let me see the code in your index.php file?

Daniel Atakpa Since Jun 17, 2015 5 Posts
<?php echo "HELLO WORLD"; ?>
zooboole Since Jan 22, 2015 112 Posts

That looks simple. It is not supposed to cause any error.

Look, make it simple go and download a new copy of php desktop here: https://code.google.com/p/phpdesktop/wiki/DownloadChrome then remove all files from the www folder and place in it your own index.php.

Before you compile it with Inno Setup launch php desktop to make sure it works independently. That should do it

Daniel Atakpa Since Jun 17, 2015 5 Posts

Thank you for your replies. I truly appreciate. Meanwhile, I have downloaded new setup as you directed in your last post. I first of all lunched php desktop independently but got a php-cgi.exe No Disk error message as, "There is no disk in the rive. Please insert a disk into drive \Device\Harddisk2\DR2" with the option to Cancel, Try Again or Continue. Clicking any of the option, makes the application to work fine.

I went ahead to compile using Inno Setup but the error message I get after running the application has been "PHP Desktop Chrome has stopped working".

zooboole Since Jan 22, 2015 112 Posts

This problem may be caused my your PC's settings. I have found something concerning it of Microsoft's website: https://support.microsoft.com/en-us/kb/330137

zooboole Since Jan 22, 2015 112 Posts

Here is another solution I gave found on PHP Desktop's discussion group: https://groups.google.com/forum/?utmmedium=email&utmsource=footer#!msg/phpdesktop/FzWjpFHJSJ0/_Hrzmyu-W5sJ

Kilo Abdoul Since Jun 28, 2015 1 Posts

I really like the PHP Desktop and i am getting the following message: "Error while opening the settings file, Application will terminate immediately"

I followed your advice and still unable to get it working

Guru Tom Since Jun 29, 2015 3 Posts

thanks, but i notice that php desktop does not support php default system date and time like $DATE=date("Y/M/D")

zooboole Since Jan 22, 2015 112 Posts

@Guru, it supports, you just need to use the function date() right like this:

<?php

    $myDate = date( "Y/m/d", time() );


Guru Tom Since Jun 29, 2015 3 Posts

thank you very much for your time and patient in replying us. please i already created my database and also created my tables in sqlite3 but the problem is that how can i call the sqlite datebase into my page so that i can run query like INSERT or UPDATE or DELETE?

Guru Tom Since Jun 29, 2015 3 Posts

I'm tring to make Dreamweaver connect to and let me manage an SQLite file database for project, but cant figure out how to make it work?

I'm using CS6.

zooboole Since Jan 22, 2015 112 Posts

@Guru Sorry the delay of my answer. It usually happens the same way you do with other DBMS like MySQL.

You can do it this way:

$dir = 'sqlite:/[YOUR-PATH]/combadd.sqlite';
$dbh  = new PDO($dir) or die("cannot open the database");
$query =  "SELECT * FROM combo_calcs WHERE options='easy'";
foreach ($dbh->query($query) as $row)
{
    echo $row[0];
}

Source: http://stackoverflow.com/questions/16728265/how-do-i-connect-to-an-sqlite-database-with-php

And the method I use is this:

 // Create (connect to) SQLite database in file
    $file_db = new PDO('sqlite:messaging.sqlite3');
    // Set errormode to exceptions
    $file_db->setAttribute(PDO::ATTR_ERRMODE, 
                            PDO::ERRMODE_EXCEPTION);

    // Create new database in memory
    $memory_db = new PDO('sqlite::memory:');
    // Set errormode to exceptions
    $memory_db->setAttribute(PDO::ATTR_ERRMODE, 
                              PDO::ERRMODE_EXCEPTION);

Source: http://www.if-not-true-then-false.com/2012/php-pdo-sqlite3-example/

Mohammad Since Aug 10, 2015 1 Posts

Great tutorial. Thanks.

One thing to ask here, all of our php files will be exposed in the Program Folder and no security, right?

zooboole Since Jan 22, 2015 112 Posts

Indeed @Mohammad, but there are ways to solve that problem. Check this out: https://code.google.com/p/phpdesktop/wiki/KnowledgeBase#HowdoIprotectPHPsourcesin"www"directory?