Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


3588 posts

Uber Geek
+1 received by user: 1318

Subscriber

Topic # 150916 7-Aug-2014 15:43
Send private message

Hi all,
Just having a bit of a fiddle with this...

Yealink make awesome IP phones with the ability to hook it up to a remote phonebook which is a xml page.

Some clever people have built a nice looking way to easily manage your phoenbooks as well as have it automatically generate the XML files but I just can't make the dam thing work!
Here is the Github repo...
https://github.com/octivi/yealink-phonebook

The way I read that is copy the files straight in to the web directory on the server and it should work. I do that, but when I try to browse to the page in Chrome browser it is just a blank page (view source is just empty). When I look at in in IE11 it comes back with error 500.

At the moment I have just been trying it on virtual server on my home VMware host. It is running CentOS with Apache and PHP version 5. Oh and it is only local so any security concerns you have don't worry about it.

I have next to zero knowledge of PHP and am just wondering if it is a package I need to add to the server.

Can anyone give me any pointers on what to look for?! By the looks of the screenshots it should all work so I can only assume I am doing something wrong.

Any help much appreciated!!

Cheers,
Sam

Create new topic
Webhead
2110 posts

Uber Geek
+1 received by user: 685

Moderator
Trusted
Lifetime subscriber

  Reply # 1104201 7-Aug-2014 15:49
Send private message

Your best bet is probably to read the documentation. 

That said, you should look at your error log, that should tell you whats going wrong. Probably a web server configuration error or something like that.

The 500 error you are getting means something has gone wrong, my guess would be problems with the .htaccess files.


EDIT: Removed comment about closing php tag. Should not make any difference whatsoever, other than to people with OCD ;)




gzt

10181 posts

Uber Geek
+1 received by user: 1560


  Reply # 1104203 7-Aug-2014 15:51
One person supports this post
Send private message

Try something simple like this to find out if your php/apache is actually configured and really operating:

http://www.cyberciti.biz/faq/how-do-i-test-php-installation-with-a-phpinfo-page/

3409 posts

Uber Geek
+1 received by user: 404

Trusted

  Reply # 1104236 7-Aug-2014 16:57
Send private message

Can you show us your error log? WHAT PBX are you using also? I remember setting a script in Asterisk that dynamically built the phonebook for all extensions as it was called - much easier than maintaining a separate list as you add/edit/delete extensions.






2091 posts

Uber Geek
+1 received by user: 848


  Reply # 1104261 7-Aug-2014 17:18
2 people support this post
Send private message

Turn off friendly http messages in IE
enable show errors in your php.ini on server
load page
look at errors

Baby Get Shaky!
1570 posts

Uber Geek
+1 received by user: 392

Trusted
Subscriber

  Reply # 1104286 7-Aug-2014 18:24
Send private message

Just did a test install on CentOs 6.5 with Apache 2.4.1 and PHP 5.5.14, worked like a charm straight out of the box.

How did you install you LA(M)P? Are you sure you have loaded all required modules/packages?

If you want to spin up another VM you could try using one of the many free CP's out there to install all required packages and configure it as a web environment... Something like Z Panel, ISPConfig, Kloxo etc.

PHP is a fickle beast, best of luck.




3588 posts

Uber Geek
+1 received by user: 1318

Subscriber

  Reply # 1104307 7-Aug-2014 19:23
Send private message

I am testing this on the FreePBX distro as that is what I would like to use in the long term on production boxes. The web server is already installed as part of the distro install. The FreePBX web inetrface is functioning fine so I figure PHP is configured fine for that side of it. It is CentOS 5.8, Apache 2.2.3 and PHP 5.3.10

So I managed to make it display some errors....


Warning
: require_once(/var/www/html/directory/app/../vendor/autoload.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/html/directory/app/bootstrap.php on line 9

Fatal error: require_once() [function.require]: Failed opening required '/var/www/html/directory/app/../vendor/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/directory/app/bootstrap.phpon line 9


Seems to me it is looking for this 'autoload.php' file in a non-existant directory. So how come it has worked for some and not for me? It's the same script right?



3588 posts

Uber Geek
+1 received by user: 1318

Subscriber

  Reply # 1104311 7-Aug-2014 19:42
Send private message

Zeon: Can you show us your error log? WHAT PBX are you using also? I remember setting a script in Asterisk that dynamically built the phonebook for all extensions as it was called - much easier than maintaining a separate list as you add/edit/delete extensions.



I'm not going for a directory of extensions rather a speed dial list.

I normally use a little Python script that pulls the Asterisk Phonebook and converts it to XML for the phones. Only thing is the Asterisk Phonebook is super basic and this little thing will make it all a lot more flexible.



3588 posts

Uber Geek
+1 received by user: 1318

Subscriber

  Reply # 1107069 12-Aug-2014 14:11
Send private message

Hi all, still trying to figure this out.

So just to recap - CentOS 5.8, Apache 2.2.3, PHP 5.3.10, so yes a little older but that is what FreePBX use with their distro and is what I will use in production.

To get the files I just did a simple 'git clone' of https://github.com/octivi/yealink-phonebook.git and then copied the files in to the web directory.

PHP error log just always has the same two lines.....


[12-Aug-2014 02:05:23 UTC] PHP Warning: require_once(/var/www/html/yealink-phonebook/app/../vendor/autoload.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /var/www/html/yealink-phonebook/app/bootstrap.php on line 9
[12-Aug-2014 02:05:23 UTC] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required '/var/www/html/yealink-phonebook/app/../vendor/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/yealink-phonebook/app/bootstrap.php on line 9


The way I look at the various 'index.php' files is they just redirect to another script somewhere else until it eventually gets to the one it can't find.

I just can't understand why they make reference to this 'vendor' directory and then the 'autoload.php'. Also, why does the error talk about pear? Do you think I need to change something in the index files?

I'm about to put this in the too hard basket but I'm sure it must just be something simple and stupid I am doing.

2091 posts

Uber Geek
+1 received by user: 848


  Reply # 1107090 12-Aug-2014 14:55
One person supports this post
Send private message

chevrolux: I am testing this on the FreePBX distro as that is what I would like to use in the long term on production boxes. The web server is already installed as part of the distro install. The FreePBX web inetrface is functioning fine so I figure PHP is configured fine for that side of it. It is CentOS 5.8, Apache 2.2.3 and PHP 5.3.10

So I managed to make it display some errors....


Warning
: require_once(/var/www/html/directory/app/../vendor/autoload.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/html/directory/app/bootstrap.php on line 9

Fatal error: require_once() [function.require]: Failed opening required '/var/www/html/directory/app/../vendor/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/directory/app/bootstrap.phpon line 9


Seems to me it is looking for this 'autoload.php' file in a non-existant directory. So how come it has worked for some and not for me? It's the same script right?


OK
require_once is a php function to pull in another file. This is failing.
No such file or directory - prettty obvious
'/var/www/html/directory/app/../vendor/autoload.php' is the file failing
../ is the same as going up one directory
so look in /var/www/html/directory/vendor/autoload.php - does this file exist?

Is there a config file for the web app you are trying to deploy that requires entering in some config before working?

PEAR = PHP Extension and Application Repository - like CPAN for PHP

 

 

23 posts

Geek
+1 received by user: 1


  Reply # 1107108 12-Aug-2014 15:53
Send private message

If you are following the instructions, they recommend using a release file - this isn't the same as downloading the repo.
You can get it from this page:
https://github.com/octivi/yealink-phonebook/releases
or http://labs.octivi.com/yealink-phone-book-manager-released/

Then follow the other two steps in the process and see how you go. Good luck :)



3588 posts

Uber Geek
+1 received by user: 1318

Subscriber

  Reply # 1107149 12-Aug-2014 16:31
Send private message

Wow. I feel rather stupid. Just assumed when they said release they were just referring to the repo.

So I chucked the actual release file in to the server. It loads up the page but nothing is clickable..... PHP error log says this.....


[12-Aug-2014 04:28:18 UTC] PHP Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Entity: line 1: parser error : Start tag expected, '&lt;' not found in phar:///var/www/html/directory/yealink-phonebook.phar/src/Octivi/Service/XMLFileService.php on line 44
[12-Aug-2014 04:28:18 UTC] PHP Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: &lt;?xml version='1.0'?&gt;. in phar:///var/www/html/directory/yealink-phonebook.phar/src/Octivi/Service/XMLFileService.php on line 44
[12-Aug-2014 04:28:18 UTC] PHP Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: ^ in phar:///var/www/html/directory/yealink-phonebook.phar/src/Octivi/Service/XMLFileService.php on line 44
[12-Aug-2014 04:28:18 UTC] PHP Warning: Invalid argument supplied for foreach() in phar:///var/www/html/directory/yealink-phonebook.phar/src/Octivi/Form/DataEditForm.php on line 44
[12-Aug-2014 04:28:18 UTC] PHP Fatal error: Class 'DOMDocument' not found in phar:///var/www/html/directory/yealink-phonebook.phar/vendor/symfony/translation/Symfony/Component/Translation/Loader/XliffFileLoader.php on line 93

23 posts

Geek
+1 received by user: 1


  Reply # 1107165 12-Aug-2014 16:54
Send private message

Did you get that after editing the .htaccess file?
I'd suggest trying it with the defaults first and see if you still get errors.
I just tried it here and it opens without problems.



23 posts

Geek
+1 received by user: 1


  Reply # 1107171 12-Aug-2014 17:07
Send private message

I mean the default .htaccess and index.php files - everything exactly as downloaded.
The default/demo contacts.xml with one entry should be loaded.



3588 posts

Uber Geek
+1 received by user: 1318

Subscriber

  Reply # 1107834 13-Aug-2014 17:42
Send private message

Thanks so much for the help!!

I thought I would try it on another OS so spun up a debian instance and installed the same versions of Apache & PHP.

Loaded the files as was suggested earlier in the thread and low and behold it all worked fine - actually it worked extremely well, i really really like it.

I can only assume FreePBX muck around with PHP in their distro. When I have a decent amount of time I will sit down and try to figure out the difference. Don't think I will get very far.

Webhead
2110 posts

Uber Geek
+1 received by user: 685

Moderator
Trusted
Lifetime subscriber

  Reply # 1107882 13-Aug-2014 18:18
Send private message

chevrolux: Thanks so much for the help!!

I thought I would try it on another OS so spun up a debian instance and installed the same versions of Apache & PHP.

Loaded the files as was suggested earlier in the thread and low and behold it all worked fine - actually it worked extremely well, i really really like it.

I can only assume FreePBX muck around with PHP in their distro. When I have a decent amount of time I will sit down and try to figure out the difference. Don't think I will get very far.


Make yourself a little test.php file and add <?php phpinfo(); ?> - That will let you know which modules are installed. If you do that on both you might be able to see something missing on the FreePBX install. (But there is a lot of info on that PHPinfo page, so not sure you will find anything :)




Create new topic

Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.