write command line code in php
Posted: Tue Dec 14, 2010 3:56 am
Hello,
I have windows and apache server installed in my computer. I want to execute command line code with php.
for instance, if I type this code in command line window shp2qgsql buildings.shp > bui.sql
it will convert shape file to sql table in certain file directory.Now I want to develope an application that do it automatically. It means I want to execute this code in php so whenever my webpage run it, it will generate a sql table. I found a exec() might be right function. My code look like this:
<?php
$result ="shp2pgsql buildings.shp > bui.sql";
exec('/usr/bin/top -b -n1, $result');
?>
but I didn“t get the sql table in the directory. Can anyone help me?
Many Thanks
I have windows and apache server installed in my computer. I want to execute command line code with php.
for instance, if I type this code in command line window shp2qgsql buildings.shp > bui.sql
it will convert shape file to sql table in certain file directory.Now I want to develope an application that do it automatically. It means I want to execute this code in php so whenever my webpage run it, it will generate a sql table. I found a exec() might be right function. My code look like this:
<?php
$result ="shp2pgsql buildings.shp > bui.sql";
exec('/usr/bin/top -b -n1, $result');
?>
but I didn“t get the sql table in the directory. Can anyone help me?
Many Thanks