0

I am reading about how to create a sevice like:

The first link I read is. https://geekytheory.com/crear-un-servicio-en-linux

But when I type following line in prompt

$ sudo service nameservice start
Failed to start nameservice.service: Unit nameservice.service not found

I create this script

/var/www/myproject/myscript.php

I checked all the permissions

-rwxrwxrwx 1 root root 1069 feb 2 15:49 nameservice 
-rwxrwxrwx 1 root root 24 feb 2 15:56 myscript.php

/var/www/myproject/myscript.php has this content

<?php
    echo "OK";
?>

Could you help me? This is the first manual script I wrote.

My intention is to add this service and then call the url http://localhost/getanswer to show it to me in the browser.

muru
  • 197,895
  • 55
  • 485
  • 740
Iván
  • 1

2 Answers2

0

I believe that the guide you linked here does something different than what you want to do. In order to run php, you need apache and php installed and configured, have a look here:

https://help.ubuntu.com/community/ApacheMySQLPHP

then you can start apache by running

sudo systemctl start apache2

(maybe you need top run php too) then open the browser and go to

http://localhost/myproject/myscript.php

to see your php running

  • Well I think I have this working.

    I open the browser and go to

    http://localhost/myproject/myscript.php

    and I have answer expected like: browser

    <?php
       echo "OK";
    ?>
    
    

    Then I need how to connect with post request of this url to show one answer or other.

    – Iván Feb 03 '17 at 10:10
0

Well I think I have this working.

I open the browser and go to

http://localhost/myproject/myscript.php

and I have answer expected like: browser

<?php
   echo "OK";
?>

Then I need how to connect with post request of this url to show one answer or other.

Iván
  • 1