|
PHP Installing on Debian Linode |
Posted by Jorge Eduardo Ardila on Jun-12-2013 10:41 |
|
Hi Peter, and here I go again with installing php version.
This time, I have a totally controlled virtual private server, running Debian 7 on Linode.
I followed the instructions:
i) copy the contents of /lib to /usr/lib/php5/20100525 which appears to be the extension
dir.
ii) My php version is 5.4.
iii) Added this extension=phpchartdir540.dll to php.ini.
When testing the /phpdemo, this is what I receive:
Warning: require_once(../lib/phpchartdir.php): failed to open stream: No such file or
directory in /home/jea/public/datelligent.com/public/chd/phpdemo/cdinfo.php on line 12
Fatal error: require_once(): Failed opening required '../lib/phpchartdir.php'
(include_path='.:/usr/share/php:/usr/share/pear') in
/home/jea/public/datelligent.com/public/chd/phpdemo/cdinfo.php on line 12
For sure can't load the phpchartdir.php file which actually is located on
/usr/lib/php5/20100525/, the question is how to force it's loading?
here is a link to check phpinfo: https://datelligent.com/echo.php
Thanks in advance, Jorge |
Re: PHP Installing on Debian Linode |
Posted by Peter Kwan on Jun-13-2013 00:28 |
|
Hi Jorge,
PHP will automatically load all "PHP extensions" (which are shared objects or dynamic loading libraries) in the PHP extension directory. So all ".so" or ".dll" files should be copied to the PHP extension directory.
Note that the above applies to PHP extensions, not to PHP include files (".php" files). For PHP include files, if no directory path is provided, PHP will search using the PHP include path (according to your phpinfo, it is ".:/usr/share/php:/usr/share/pear"). However, for the ChartDirector sample code, the directory path is provided as "../lib", so the suggested method is to simply put the "phpchartdir.php" in the "../lib" subdirectory. In your case, the "../lib" directory is at "/home/jea/public/datelligent.com/public/chd/lib" (please create this directory if it does not already exist.)
Please kindly let me know if the above can solve the problem.
Regards
Peter Kwan |
Re: PHP Installing on Debian Linode |
Posted by Jorge Eduardo Ardila on Jun-13-2013 04:51 |
|
HI Peter, I created and placed the phpchartdir.php on the lib file as you told me.
However when testing the demo I get this message:
Hi Peter, now I understand.
Error Loading ChartDirector for PHP Extension
It appears this PHP system has not loaded the ChartDirector extension by using an
extension statement in the PHP configuration file (typically called "php.ini"). An attempt
has been made to dynamically load ChartDirector on the fly, but it was not successful.
Please refer to the Installation section of the ChartDirector for PHP documentation on how
to resolve this problem.
Error Log
The version and type of PHP in this system does not support dynmaic loading of PHP
extensions. All PHP extensions must be loaded by using extension statements in the PHP
configuration file.
System Information
Operating System : Linux datelligent006 3.9.3-x86_64-linode33 #1 SMP Mon May 20
10:22:57 EDT 2013 x86_64
PHP version : 5.4.4-14
PHP / Web Server interface : apache2handler
PHP configuration file location : "/etc/php5/apache2/php.ini"
PHP extension directory : "/usr/lib/php5/20100525"
Thanks, Jorge |
Re: PHP Installing on Debian Linode |
Posted by Jorge Eduardo Ardila on Jun-13-2013 08:53 |
|
Hi Peter:
I also executed a ls -l command on the extension dir: heres is the result:
-rwxr-xr-x 1 jea jea 108063 Jun 12 02:11 FinanceChart.php
-rw-r--r-- 1 root root 104576 Mar 4 14:32 gd.so
-rwxr-xr-x 1 jea jea 4295800 Jun 12 02:11 libchartdir.so
-rw-r--r-- 1 root root 43192 Mar 4 14:32 mcrypt.so
-rw-r--r-- 1 root root 141528 Mar 4 14:32 mysqli.so
-rw-r--r-- 1 root root 55432 Mar 4 14:32 mysql.so
-rw-r--r-- 1 root root 35224 Mar 4 14:32 pdo_mysql.so
-rw-r--r-- 1 root root 113072 Mar 4 14:32 pdo.so
-rwxr-xr-x 1 jea jea 12128 Jun 12 02:11 phpchartdir421.dll
-rwxr-xr-x 1 jea jea 12128 Jun 12 02:11 phpchartdir421mt.dll
-rwxr-xr-x 1 jea jea 12128 Jun 12 02:11 phpchartdir500.dll
-rwxr-xr-x 1 jea jea 12128 Jun 12 02:11 phpchartdir500mt.dll
-rwxr-xr-x 1 jea jea 12128 Jun 12 02:11 phpchartdir503.dll
-rwxr-xr-x 1 jea jea 12128 Jun 12 02:11 phpchartdir503mt.dll
-rwxr-xr-x 1 jea jea 12224 Jun 12 02:11 phpchartdir510.dll
-rwxr-xr-x 1 jea jea 12224 Jun 12 02:11 phpchartdir510mt.dll
-rwxr-xr-x 1 jea jea 12224 Jun 12 02:11 phpchartdir520.dll
-rwxr-xr-x 1 jea jea 12224 Jun 12 02:11 phpchartdir520mt.dll
-rwxr-xr-x 1 jea jea 12224 Jun 12 02:11 phpchartdir530.dll
-rwxr-xr-x 1 jea jea 12224 Jun 12 02:11 phpchartdir530mt.dll
-rwxr-xr-x 1 jea jea 12160 Jun 12 02:11 phpchartdir540.dll
-rwxr-xr-x 1 jea jea 12160 Jun 12 02:11 phpchartdir540mt.dll
-rwxr-xr-x 1 jea jea 137163 Jun 12 02:11 phpchartdir.php
Could it be a matter of ownership and privileges? |
Re: PHP Installing on Debian Linode |
Posted by Peter Kwan on Jun-14-2013 00:42 |
|
Hi Jorge,
I assume you have already added the following line in your "/etc/php5/apache2/php.ini" file:
extension=phpchartdir540.dll
After that, have you restart Apache? Because your Apache/PHP is configured to use the "Apache 2.0 Handler" (as opposed to CGI/FastCGI), so any change to "php.ini" is ignored until the Apache restarts.
If the above still cannot solve the problem, please try to read the Apache error log file. Usually, it will contain some error messages explaining why "phpchartdir540.dll" cannot be loaded.
Security can be one of the issues, especially if you have enabled Secure Linux extensions (SELinux). If SELinux is enabled, even if you allow everyone to have access to the files using "chmod", the web server may still does not have access, because SELinux has access control list and other things that may prevent the web server from reading those files. As a quick test, you may disable SELinux to see if this can solve the problem. If this works, we can confirm it is security related, and you may enable SELinux and investigate further on which SELinux feature has disabled the access. See:
http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&thread=1128577443#N1369848792
Please kindly let me know if the above can solve the problem.
Regards
Peter Kwan |
Re: PHP Installing on Debian Linode |
Posted by Jorge Eduardo Ardila on Jun-14-2013 02:54 |
|
Hi Peter:
A sample of the apache error log:
[Thu Jun 13 00:59:21 2013] [error] [client 190.85.130.137] PHP Fatal error:
require_once(): Failed opening required '/lib/phpchartdir.php'
(include_path='.:/usr/share/php:/usr/share/pear') in
/home/jea/public/datelligent.com/public/chd/phpdemo/cdinfo.php on line 12, referer:
https://datelligent.com/chd/phpdemo/indexright.php
And yes indeed, the extension is on php.ini as indicated.
Thanks, Jorge |
Re: PHP Installing on Debian Linode |
Posted by Jorge Eduardo Ardila on Jun-14-2013 04:31 |
|
Hi Peter:
I found an additional error message:
[Thu Jun 13 18:53:07 2013] [error] [client 190.85.130.137] PHP Fatal error: Call to
undefined function getDescription() in
/home/jea/public/datelligent.com/public/chd/phpdemo/cdinfo.php on line 15, referer:
https://datelligent.com/chd/phpdemo/indexright.php
Thanks, Jorge |
Re: PHP Installing on Debian Linode |
Posted by Peter Kwan on Jun-15-2013 01:48 |
|
Hi Jorge,
It should not be these two lines, but are lines that occur when your Apache server restart. Please try the followings:
(a) Intentionally create an error condition on the Apache web server, such as accessing a non-existent page.
(b) Restart Apache. Note the time when your Apache is restarted.
(c) Try to see if ChartDirector is working.
(d) If it is not working, please look at the error log file (and other log files) for the log that appears around the time your Apache is restarted. You should see the error about accessing the non-existent page in (a). After that line, please check if there are any useful error message. If the PHP cannot load the extension=phpchartdir540.dll, it should at least produce some error message.
Another method is to run the PHP from the command line. (I assume you have installed command line PHP as well.) In this way, you can see the error message easily. First, goto the directory that contains "cdinfo.php", then enter from the command line "php cdinfo.php". Please let me know what is the result.
Are you on a host shared by many users? If this is the case, are you able to see the complete error log for the web server (which contains information on all other parties on the server). On some hosts, the error log provided to an account only contains the error related to that user. It does not contain system events affecting everyone, such as events related to restarting the Apache server.
Regards
Peter Kwan |
Re: PHP Installing on Debian Linode |
Posted by Jorge Eduardo Ardila on Jun-15-2013 03:06 |
|
Hi Peter. Did the first step and nothing changed.
Here is the result of the php cdinfo.php execution from command line:
<html>
<body topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0"
marginheight="0">
<div style="margin:5;">
<div style="font-family:verdana; font-weight:bold; font-size:18pt;">
ChartDirector Information
</div>
<hr color="#000080">
<div style="font-family:verdana; font-size:10pt;">
<div style="font-family:verdana; font-weight:bold; font-size:14pt;">
Error Loading ChartDirector for PHP Extension
</div><br>
It appears this PHP system has not loaded the ChartDirector extension by using an
extension
statement in the PHP configuration file (typically called "php.ini"). An attempt has been
made
to dynamically load ChartDirector on the fly, but it was not successful. Please refer to
the
Installation section of the ChartDirector for PHP documentation on how to resolve this
problem.
<br><br><b><u>Error Log</u></b><br><br>
<br><b>Trying to load "phpchartdir540.dll" from the PHP extension directory
"/usr/lib/php5/20100525".</b><br><br>dl(): Dynamically loaded extensions aren't
enabled<br><br><br>
<b><u>System Information</u></b>
<ul>
<li>Operating System : Linux datelligent006 3.9.3-x86_64-linode33 #1 SMP Mon May 20
10:22:57 EDT 2013 x86_64<li>PHP version : 5.4.4-14<li>PHP / Web Server interface :
cli<li>PHP configuration file location : "/etc/php5/cli/php.ini"</td></tr>
<li>PHP extension directory : "/usr/lib/php5/20100525"</ul>
</div> |
Re: PHP Installing on Debian Linode |
Posted by Jorge Eduardo Ardila on Jun-15-2013 03:23 |
|
Hi Peter: I continue with description of what I found:
Forced error: nonexistent page:
[Fri Jun 14 19:16:19 2013] [error] [client 190.85.130.137] File does not exist:
/home/jea/public/datelligent.com/public/mamamma
Restart apache service:
[Fri Jun 14 19:16:41 2013] [notice] caught SIGTERM, shutting down
[Fri Jun 14 19:16:42 2013] [notice] Apache/2.2.22 (Debian) mod_ssl/2.2.22
OpenSSL/1.0.1e configured -- resuming normal operations
Checked the phpdemo and no error is registered:
Other logs: access.log, no related errors.
But other_vhosts_access.log shows me this:
www.datelligent.com:443 190.85.130.137 - - [14/Jun/2013:19:20:56 +0000] "GET
/chd/phpdemo/cdinfo.php HTTP/1.1" 200 1124
"https://datelligent.com/chd/phpdemo/indexright.php" "Mozilla/5.0 (X11; Linux x86_64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" |
Re: PHP Installing on Debian Linode |
Posted by Jorge Eduardo Ardila on Jun-15-2013 03:37 |
|
other error message when trying to load the demo (executing the cdinfo.php) from
other_vhosts_access.log:
www.datelligent.com:443 190.85.130.137 - - [14/Jun/2013:19:34:31 +0000] "GET
/chd/phpdemo/cdinfo.php HTTP/1.1" 200 1124
"https://datelligent.com/chd/phpdemo/indexright.php" "Mozilla/5.0 (X11; Linux x86_64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" |
Re: PHP Installing on Debian Linode |
Posted by Jorge Eduardo Ardila on Jun-15-2013 04:03 |
|
Hi Peter: I found the problem.
It was my fault, I changed php.ini in my text editor, then uploaded and thought that
changes have been done. But I downloaded the server php.ini and noticed that no
extension was enabled.!!!!!!
Wrote it with nano, directly on the server and now is working fine.
Thanks for the help and patience. Jorge. |
|