| View previous topic :: View next topic |
| Author |
Message |
bencwai
Joined: 21 Apr 2008 Posts: 5
|
Posted: Tue Apr 22, 2008 5:46 am Post subject: Image_Barcode--Cannot display the barcode |
|
|
I tried the example of "test-image-barcode.php" but it is not work like the following pic.
Would somebody please help me?Thanks a lot
Is it the problem of My GD Library? I am using hosting server I dont know how to modify its config . |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1053
|
Posted: Tue Apr 22, 2008 8:20 am Post subject: |
|
|
| What happens if you open one of the image URLs directly in your browser? It's likely that it will show you some PHP error messages, maybe because of some include issues. |
|
| Back to top |
|
 |
bencwai
Joined: 21 Apr 2008 Posts: 5
|
Posted: Wed Apr 23, 2008 8:36 am Post subject: |
|
|
| mark wrote: | | What happens if you open one of the image URLs directly in your browser? It's likely that it will show you some PHP error messages, maybe because of some include issues. |
Thanks for your reply.But I cant see anything when i opened one of the image URLs directly in your browser. |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1053
|
Posted: Wed Apr 23, 2008 2:56 pm Post subject: |
|
|
It might help to insert the following four lines at the beginning of the script that generates the images:
| Code: |
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once 'PEAR.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
|
|
|
| Back to top |
|
 |
bencwai
Joined: 21 Apr 2008 Posts: 5
|
Posted: Tue May 13, 2008 6:36 am Post subject: |
|
|
| mark wrote: | It might help to insert the following four lines at the beginning of the script that generates the images:
| Code: |
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once 'PEAR.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
|
|
Thanks for your suggestion, but it still not workable.It showed me the following error message:
| Code: | Warning: require_once() [function.require-once]: URL file-access is disabled in the server configuration in /home/xplus/public_html/PEAR171/PEAR/docs/Image_Barcode/docs/examples/test-image-barcode.php on line 45
Warning: require_once(http://www.xplus.com.hk/PEAR171/PEAR/) [function.require-once]: failed to open stream: no suitable wrapper could be found in /home/xplus/public_html/PEAR171/PEAR/docs/Image_Barcode/docs/examples/test-image-barcode.php on line 45
Fatal error: require_once() [function.require]: Failed opening required 'http://www.xplus.com.hk/PEAR171/PEAR/' (include_path='.:') in /home/xplus/public_html/PEAR171/PEAR/docs/Image_Barcode/docs/examples/test-image-barcode.php on line 45 |
|
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1053
|
Posted: Tue May 13, 2008 9:23 am Post subject: |
|
|
| Well, you seem to be using URLs (http://...) in your require_once calls. That isn't allowed on that server and it wouldn't work, anyway. Using the original calls is the right way. You maybe need to adjust your include_path. |
|
| Back to top |
|
 |
bencwai
Joined: 21 Apr 2008 Posts: 5
|
Posted: Mon Jun 02, 2008 8:15 am Post subject: |
|
|
| mark wrote: | | Well, you seem to be using URLs (http://...) in your require_once calls. That isn't allowed on that server and it wouldn't work, anyway. Using the original calls is the right way. You maybe need to adjust your include_path. |
I have reinstall PEAR in the server(web hosting server) and I have added the | Code: | error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once '/home/xplus/public_html/PEAR/PEAR.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE); | before generating the barcode. At this time, it didnt say any error message but it still cant show the barcode just like the first picture of this post.
I am wondering that if there are any problem with my PEAR. It is because i didnt follow the instruction after the installation as follow.
| Quote: |
To use PEAR without any problems you need to add your
PEAR Installation path (/home/rk2trade/public_html/PEAR)
to your include_path. |
I didnt follow the above message because i dont know how to include_path in a web hosting space.  |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1053
|
Posted: Mon Jun 02, 2008 9:05 am Post subject: |
|
|
| Yes, the include_path is indeed important. Possibilities are php.ini, httpd.conf, .htacess or your own scripts (PHP function set_include_path()). |
|
| Back to top |
|
 |
|