0
votes

I am trying to connect to an index.php file located in the directory /var/lib/asterisk/agi-bin/index.php located at my Asterisk server. When I try connect I use /var/lib/asterisk/agi-bin/index.php url, but I get error 404 every time. I have used chmod 777 on the file too, which should make it visible to all, including my browser.

I have no idea of what to do in order to make it even more visible than the 777...

2

2 Answers

0
votes

It sounds like you are trying to open the index.php file in you web browser. If this is the case you probably want to put it into a directory that you web server is serving. (For example using apache /var/www/html/index.php)

The /var/lib/asterisk/agi-bin/ directory is for storing scripts that you plan to access using AGI from the dialplan. For example in /etc/asterisk/extensions.conf

[agi-test]
exten => 100,1,NoOp(calling AGI script)
same => n,AGI(index.php)

For more information see:

https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Application_AGI

http://www.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/AGI.html

0
votes

I am an experienced Apache and Asterisk engineer, but today this questions has nothing at all to do with Asterisk. This is simply about serving up a PHP page, nothing more.

You can test this by hitting the same URL from the box to the box by running this command lynx http://some.thing.com/path/index.php and see what you get. You can run this command at the same time that you do that, in another terminal, to see what is happening tail -f /var/log/httpd/access_log You might need to run apachectl -S to figure out more about what exactly your server is serving up. You might try lynx http:// 127.0.0.1/path/to/file/index.php or lynx http:// localhost/path/to/file/index.php all the while watching that log you are tailing. You might try lynx http:// fqdn/path/to/file/index.php assuming your DNS or your /etc/hosts file are correct and working.

Once you get some more information there, go back to hitting the file form your laptop, while still tailing the log. You might also run php path/to/file/index.php form the BASH prompt as the asterisk user or as root to see what those do for you, depending on what that PHP file is supposed to do. It might require some input and not run at all if it does not receive that input.

Depending on where you end up there, you will need to start digging in to the PHP file/script itself. It would seem that you might be trying to make it do something it was not designed to do.

If that file (or any of your others) really is to be served-up by apache, you might symlink that file from its current location to the appropriate (ie: /var/www/html/) directory on your file system.

Post the output from your logs and your *history here for me to comment on.