PageRenderTime 26ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/framework/lib/jpgraph/docportal/chunkhtml/ch03s07.html

https://github.com/nephie/AZL-website
HTML | 88 lines | 88 code | 0 blank | 0 comment | 0 complexity | ef9f64bc3a8f1b52118638a037b9d61d MD5 | raw file
  1. <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>3.7. Troubleshooting the installation</title><link rel="stylesheet" href="manual.css" type="text/css"><meta name="generator" content="DocBook XSL-NS Stylesheets V1.74.0"><link rel="home" href="index.html" title="JpGraph Manual"><link rel="up" href="ch03.html" title="Chapter 3. The Long Version: Installing the Library"><link rel="prev" href="ch03s06.html" title="3.6. Verifying the library installation"><link rel="next" href="pt02.html" title="Part II. Basic graph creation"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.7. Troubleshooting the installation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s06.html">Prev</a> </td><th width="60%" align="center">Chapter 3. The Long Version: Installing the Library</th><td width="20%" align="right"> <a accesskey="n" href="pt02.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2511832"></a>3.7. Troubleshooting the installation</h2></div></div></div><p>Unfortunately there are many parameters in a server installation that may affect
  2. the execution of PHP so the steps below can only give some indications of how to
  3. further investigate some potential problems.</p><p>Experience shows that most of the trouble are caused by either an old buggy
  4. version of the free-type TTF library or using an old antiquated version of the GD
  5. library. So before starting trouble shooting the scripts please make sure that you
  6. have an up to date PHP installation with the bundled version of the GD library (as
  7. describe in the previous sections) and a working FreeType library installed.</p><div class="orderedlist"><ol type="1"><li><p><span class="bold"><strong>No image is displayed.</strong></span></p><p>The first thing you should do is to isolate the problem by calling
  8. your graph script directly in the browser. There are then two variants
  9. of this problem. </p><p>
  10. </p><div class="orderedlist"><ol type="a"><li><p>No data is sent back from the server.</p><p>You can verify this by calling your graph script directly
  11. in the browser and then check the source (click "view
  12. source" menu item in the browser). If this is a truly blank
  13. image then no data was sent back from the browser.</p><p>This means that the PHP process has been terminated
  14. prematurely before it could send any data back. This could
  15. be caused by either the PHP process crashing (due to a bug
  16. in either PHP or your HTTP server) or the HTTP server
  17. crashed. This is often due to a broken PHP installation and
  18. more than often a problem with the True Type libraries. </p><p>It could also be caused by the PHP script running longer
  19. than the maximum allowed execution time (as specified in
  20. <code class="filename">php.ini</code>). The first thing you
  21. should do is to increase the maximum allowed execution time.
  22. If this does not solve the problem you should look in the
  23. log files for both your HTTP server and PHP to try to find
  24. clues to if the PHP process really crashed. Another
  25. possibility is that the PHP process uses more than the
  26. maximum allowed memory (as set in
  27. <code class="filename">php.ini</code>) and then it is terminated.
  28. So a good first step is to put some really high values for
  29. memory and time just to take away these parameters.</p></li><li><p>The data sent back is corrupt.</p><p>Depending on your browser this can show up differently but
  30. a common symptom is a "red X" in the browser. In order to
  31. debug this you should make sure that you have followed the
  32. steps in <a class="xref" href="ch03s03.html#sec2.config-dev-server" title="3.3.1. Configuring JpGraph/PHP on a development server">Section 3.3.1</a> to make sure you
  33. have output buffering disabled and have maximum error
  34. checking enabled in PHP. The most common cases for this type
  35. of problem is having enabled output buffering and some minor
  36. errors in the script which causes PHP to emit warnings which
  37. gets included in the image data. </p><p>A very common mistake is to have some white spaces in the
  38. script before the opening "<code class="code">&lt;?php</code>". This
  39. white space will be added to the output buffer and then get
  40. mixed up with the image data causing the image data to be
  41. corrupt. A similar problem can occur if multiple newlines
  42. are added after the final <code class="code">"?&gt;"</code>
  43. </p></li></ol></div><p>
  44. </p></li><li><p><span class="bold"><strong>An error message saying "Fonts are not available or not
  45. readable" </strong></span></p><p>When an image contains TTF fonts you might get an error message saying
  46. that the fonts are not available or not readable. If this is the case it
  47. is first necessary to check that the font files really exist in the
  48. directory that is specified in <code class="filename">jpg-config.inc.php</code>
  49. and that they are also readable by the HTTP/PHP process. If this is the
  50. case then it is necessary to check that the names of the font files are
  51. the one that JpGraph assumes, see <a class="xref" href="ch03s02.html#sec3.name-of-ttf-files" title="Name of TTF font files">the section called Name of TTF font files</a>. Another problem can be if
  52. the PHP installation is running in "safe mode" (See <code class="uri"><a class="uri" href="http://se.php.net/manual/en/ini.sect.safe-mode.php" target="_top">PHP
  53. Manual: Security and safe mode</a></code>) and has enabled strict
  54. directory policy via an "<code class="code">open_basedir</code>" restriction. This
  55. will prevent the PHP process from reading any files outside the
  56. specified base directory. If this is enabled there is no way around for
  57. PHP to read any files outside this restriction and any TTF files
  58. necessary must be moved so that they can be accessed within the realms
  59. of the specified basedirectory.</p><p>If you are running IIS and Win2k and get the error "Can't find font"
  60. when trying to use TTF fonts then try to change the paths to UNIX style,
  61. i.e. "<code class="filename">/usr/local/fonts/ttf/</code>". Remember that the
  62. path is absolute and not relative to the <code class="filename">htdocs</code>
  63. catalogue.</p><p>If you are running on Unix server please keep in mind that file names
  64. are case sensitive.</p></li><li><p><span class="bold"><strong>An error message saying "Headers have already been
  65. sent"</strong></span></p><p>A common mistake is to have a space in the beginning of the image
  66. script which the HTTP server will send back to the browser. The browser
  67. now assumes that the data coming back from this script is text since it
  68. hasn't received an explicit header. When then the image headers get sent
  69. back to the browser to forewarn the browser of the forthcoming image
  70. data the browser will not like that as it has already assumed the data
  71. stream was a text stream. The browser will then give the infamous
  72. "Headers already sent error".</p><p>Make sure that your script has no white space before the opening
  73. "<code class="code">&lt;?php</code>" statement or a number of blank lines after
  74. the concluding "<code class="code">?&gt;</code>"</p></li><li><p><span class="bold"><strong>Issues specific to Windows and IIS</strong></span></p><p>Some windows installations seems to have a problem with a PHP script
  75. ending in more than one newline (This newline seems to be sent to the
  76. browser and will cause a <span class="italic">Header already sent error</span>). To correct this
  77. problem check all your scripts for more than one empty newline after the
  78. ending "<code class="code">?&gt;</code>" statement. All files provided with the library
  79. end in exactly one final newline and should not be a problem.</p></li><li><p><span class="bold"><strong>TTF fonts are not displayed correctly</strong></span></p><p>If the TTF fonts only shows up as yellow then the installation is used
  80. a buggy (too old) installation of the FreeType font library and the only
  81. thing to do is to re-install and setup PHP+GD again with a newer version
  82. of the FreeType library. Another symptom of a an (old) buggy FreeType
  83. library is that the fonts are not correctly rotated (the text string is
  84. rotated but not the individual characters).</p></li></ol></div><p>As a final advise you should read the FAQ (available in this manual
  85. see <a class="xref" href="apc.html" title="Appendix C. FAQ">Appendix C</a>) or on the JpGraph website at <code class="uri"><a class="uri" href="http://www.aditus.nu/jpgraph/jpgraphfaq.php" target="_top">http://www.aditus.nu/jpgraph/jpgraphfaq.php</a></code></p><p>Depending on your sever it might also help to recompile PHP yourself instead of
  86. the version included with the system. You can find typical configuration scripts to
  87. compile PHP4 and PHP5 in the appendices, see <a class="xref" href="api.html" title="Appendix I. Compiling PHP">Appendix I</a>
  88. </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s06.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="pt02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.6. Verifying the library installation </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Part II. Basic graph creation</td></tr></table></div></body></html>