Php Issues

Discussion in 'Installation/Configuration' started by conductive, Sep 22, 2011.

  1. conductive

    conductive Member

    I have loaded the 6.0 Ispconfig3 server several times but can not get my php pages to work properly. The pages were working on the last server.

    Simple scripts and phpinfo work but complex pages with database querys do not work. The page background is missing and the forms will not properly process data. This seems like a GLOBALS issue since hidden variables on forms seem to be missing and may not be getting passed. There will also be a issue parsing html as php.

    I have globals on in the php.ini and it shows up in phpinfo but It does not seem to work. I have also added directives to the http.conf with out any luck. There are too many configuration files and the manual did not seem to cover this topic.

    I guess that leaves mime but I am not sure where to put the Addhaddler or Addtype directives.

    -----------------------------------------------
    HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

    default_mimetype text/html text/html
    -----------------------------------------------

    Does anybody know how get this php to go?

    Thanks
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no need to configure anything manually in httpd.conf or the vhost file as this is all configured by ispconfig. So dont add anything or you might break the system. Also remove the directives that you added to httpd.conf manually as the will most likely conflict with ispconfig.

    Back to your original problem.

    1) Which php mode do you use in that website in ispconfig and is suexec enabled?
    2) Which php mode did you use on the old server?
    3) Which php version is used on the old server?
     
  3. conductive

    conductive Member

    Thanks for the response Till. I have reset .ini, .conf and mime files and hope that I can properly answer your questions.

    1)I have tried all combinations of modes with and without SuExec and/or
    AddHandler application/x-httpd-php .php .php4 .php3 .html
    AddType application/x-httpd-php .html
    Placed into the options section of the website in isp config. The only thing that makes a difference is that SuPHP will produce a completely white page and will probably make you reboot since the apache restart seems to fail. Restart was used after all changes.

    2)I used CGI in the beginning and then switched to Fast-cgi. They both should work. I have no idea about SuPhp or Mod-php.

    3) I started with php4 and ended up using php5 they both should work or come close with a few errors.

    For the most part I really do not care what I use I just wanted to transfer a working site to another server. This was not done in a planned manner so I might not have all the answers but I do have all the old config files.

    It seems to me that I am not the first person to have this problem and that there is more information as what not to do with config files than what to do with them. Is there something I missed on parsing in the manual? Any suggestions?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    No, not really. Of course you might see a post here about such a topic, but if you compare that with the approx. 20 thousand new ispconfig installations per month, then you can see that it is not a typical problem. Most problems occur when someone edits the apache config files manually or adds any addtype or addhandler directives manually or did not follow the perfects etup guides closely. Thats why you find here often instructions to remove all customisations as this fixes almost all problems.

    No, there is nothing missing. ISPConfig is doing all the configuration.

    1) Switch the php mode to php-fcgi and enable the suexec checkbox in the website settings.
    2) Was there any other controlpanel installed on the server before? ISPConfig like all other hosting panels requires a clean and empty system for installation.
    3) Which guide did you follow to prepare the server for ispconfig and did you follow the guide closely?
    4) Please post the output of:

    ls -la

    from within the web directory of the website.
    5) Does a simple php file with:

    <?php
    phpinfo();
    ?>

    work in that site? If yes, then post the list of php.ini files atht are currently used by PHP in that specific site.
    6) if the site was originally developed with php4, then it might be nescessary that you either modify your scripts for php 5.3 or that you enable some compatibility settings in the php.ini like:

    short_open_tag = On
    asp_tags = On
    register_globals = On
    register_long_arrays = On
    register_argc_argv = On
     
  5. conductive

    conductive Member

    1) done now .php is just a white page and a .html looks like the php did before. I put directives into the options and that did not help either.

    2) No I completely formated the disk on the test server at home. The server on line might have this issue but even that has been reloaded several times.

    3) http://www.howtoforge.com/perfect-server-centos-6.0-x86_64-ispconfig-3 The home server is a 32 bit so i686 was substituted for x86_64 during the process. Server on line followed the procedure exactly but still behaves the same.

    4) There were several sites and I dumped the whole thing so I was not missing anything. This may be a little overwhelming. Is there anything in particular? File permissions perhaps, but wouldn't I get an error? Where are my errors do I need to turn on debugging? Let me know if you still want this information.

    5) OOps edit... yes phpinfo does work. Now it comes up a white page. .html still comes up like it did before.

    6) compatibility options changed the output. I am sure there are some compatibility issues, but this site works on php4 and php5 and rebuilding for a control panel is not an option.

    I have also found that this server appears to literally interpret the "/ escape characters and I had to edit a few links to correct the issue. I do not beleive I had this issue before, but these could have been untested pages.

    There clearly confusion here and ispconfig does not configure as it is supposed to. The manual needs a php parsing and/or mime section. One person needed a "listen" statement and that is not in the manual either. The listen statement refereed to a config file but it was just about impossible to determine which one since there are too many and the documentation does not spell out the difference.

    So at this point without better documentation or a way to generate errors I am at a loss.
     
    Last edited: Sep 22, 2011
  6. conductive

    conductive Member

    PHP INFO

    Loaded Configuration File /etc/php.ini

    Scan this dir for additional .ini files /etc/php.d
    Additional .ini files parsed /etc/php.d/curl.ini, /etc/php.d/dom.ini, /etc/php.d/eaccelerator.ini, /etc/php.d/fileinfo.ini, /etc/php.d/gd.ini, /etc/php.d/imap.ini, /etc/php.d/json.ini, /etc/php.d/ldap.ini, /etc/php.d/mbstring.ini, /etc/php.d/mcrypt.ini, /etc/php.d/mssql.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/odbc.ini, /etc/php.d/pdo.ini, /etc/php.d/pdo_dblib.ini, /etc/php.d/pdo_mysql.ini, /etc/php.d/pdo_odbc.ini, /etc/php.d/pdo_sqlite.ini, /etc/php.d/phar.ini, /etc/php.d/snmp.ini, /etc/php.d/soap.ini, /etc/php.d/sqlite3.ini, /etc/php.d/tidy.ini, /etc/php.d/wddx.ini, /etc/php.d/xmlreader.ini, /etc/php.d/xmlrpc.ini, /etc/php.d/xmlwriter.ini, /etc/php.d/xsl.ini, /etc/php.d/zip.ini

    Loaded Modules
    core prefork http_core mod_so mod_auth_basic mod_auth_digest mod_authn_file mod_authn_alias mod_authn_anon mod_authn_dbm mod_authn_default mod_authz_host mod_authz_user mod_authz_owner mod_authz_groupfile mod_authz_dbm mod_authz_default util_ldap mod_authnz_ldap mod_include mod_log_config mod_logio mod_env mod_ext_filter mod_mime_magic mod_expires mod_deflate mod_headers mod_usertrack mod_setenvif mod_mime mod_dav mod_status mod_autoindex mod_info mod_dav_fs mod_vhost_alias mod_negotiation mod_dir mod_actions mod_speling mod_userdir mod_alias mod_substitute mod_rewrite mod_proxy mod_proxy_balancer mod_proxy_ftp mod_proxy_http mod_proxy_ajp mod_proxy_connect mod_cache mod_suexec mod_disk_cache mod_cgi mod_version mod_fcgid mod_php5 mod_ruby mod_ssl mod_suphp
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    1) Take a look into the error.log file which is in the log directory of the website.

    4) I need the ls -la output.

    5) You did which changes?

    6) You mix up some things here. Some newer PHP5 versions are very different from older php versions, e.g. if your site works oin php 5.1, it can be boken on php 5.3. The php version is not relevant for ispconfig as ispconfig works with every php5 version, but its relevant for your website. So this is not about changing code for a controlpanel, its about changing code for a php version (which is not related to the controlpanel) or alternatively change php.ini settings to make it work.

    Dont change any mime settings. and you dont have to add any listen statements as the are there by default. if someone had to add them, then he must have been deleted before.
     
  8. conductive

    conductive Member

    Ok, now we are getting somewhere. error_log is loaded with DLL load errors. I guess it can not find them, needs a ln or more permission. It appears that both of my current loads do the same thing.

    snip .........
    [22-Sep-2011 03:57:00] PHP Warning: PHP Startup: Unable to load dynamic library './tidy.so' - ./tidy.so: cannot open shared objec
    t file: No such file or directory in Unknown on line 0
    [22-Sep-2011 03:57:00] PHP Warning: PHP Startup: Unable to load dynamic library './wddx.so' - ./wddx.so: cannot open shared objec
    t file: No such file or directory in Unknown on line 0
    [22-Sep-2011 03:57:00] PHP Warning: PHP Startup: Unable to load dynamic library './xmlreader.so' - ./xmlreader.so: cannot open sh
    ared object file: No such file or directory in Unknown on line 0
    [22-Sep-2011 03:57:00] PHP Warning: PHP Startup: Unable to load dynamic library './xmlrpc.so' - ./xmlrpc.so: cannot open shared o
    bject file: No such file or directory in Unknown on line 0
    [22-Sep-2011 03:57:00] PHP Warning: PHP Startup: Unable to load dynamic library './xmlwriter.so' - ./xmlwriter.so: cannot open sh
    ared object file: No such file or directory in Unknown on line 0
    [22-Sep-2011 03:57:00] PHP Warning: PHP Startup: Unable to load dynamic library './xsl.so' - ./xsl.so: cannot open shared object
    file: No such file or directory in Unknown on line 0
    [22-Sep-2011 03:57:00] PHP Warning: PHP Startup: Unable to load dynamic library './zip.so' - ./zip.so: cannot open shared object
    file: No such file or directory in Unknown on line 0
    -------------------------------------------------------
    The changes made @ test server
    short_open_tag = Off >>>On
    asp_tags = Off >>>On
    register_long_arrays = Off >>>>> On
    register_argc_argv = Off >>> On
    _________________________-

    I am not sure where to find the .??????.so files since the "." does not search very well.

    Where are these files and do I need to change permissions or just make a symbolic ln

    Thanks
     
  9. CSsab

    CSsab New Member

    These problems are not related to symbolic links or permissions.

    These errors means that PHP cannot open some modules which are listed in it's configuration files with 'extension' directive.

    If the PHP module that is causing you problems has been deleted and php.ini is still calling for it then you see these errors. So you can either stop php5 loading them (by commenting them out in your php.ini) or troubleshoot which module is not being loaded correctly.

    Here is an example on my system (the directories might be different on yours).

    1. I was having problems with php5-imap due to a bug.

    2. I edited this file which originally looked like this:

    /etc/php5/conf.d/imap.ini
    ; configuration for php Imap module
    extension=imap.so

    and made it look like this:

    ;extension=imap.so

    (NOTE you comment out with ; and not # in php5 files)

    3. Restart apache2 and not php5 is no longer looking to load php5-imap.


    In your case to determine which module is causing the problems list all modules which are being loaded in /etc/php5/conf.d like so:

    ls /etc/php5/conf.d

    and then try to work out which is causing the problems by commenting and then uncommenting them one at a time.
     
  10. conductive

    conductive Member

    Thanks for the clarification and good T/S technique CSsab.

    This is a fresh load and I am hope that I do not have to go there and I really need better errors to go further. I can can also say that I do not have a /etc/php5 directory on the centos 6.0 ispconfig load which adds a little to the configuration confusion.

    This server is supposed work and/or produce errors but it is becoming quite clear that even though ispconfig is huge in potential it is still developmental and does not configure itself as it should. It works excellent for html but if you use php you are out of luck. I can also say that the server that I built on a vps system crashed apache on reboot. /etc/init.d/httpd restart looks good but I can not access the server via port 80. Obviously this situation has a little more going on. Before the SNAFU it was not producing any errors other than the virtual port 80 and 443 errors which do not come up on the i686 version.

    As it turns out these errors were associated with startup or config snafu. I cleared error logs /var/www/mysite.com/log/error.log and /var/www/client/client1/web1/web/error_log and they come out clean. It appears that the only errors.

    At this point unless we have any other options I am either going to can this 6.0 ispconfig3 project until it is ready and either try a centos 5.6 ispconfig3, or just a basic lamp server.
     
  11. CSsab

    CSsab New Member

    As the title of your thread suggests, you have php5 issues and nothing in your logs suggests that ISPConfig is the problem. Thousands of people use the software with no such issues. If an essential package is modified, relocated, removed or just plain absent how is ISPConfig to know?

    You can find out where php5 is installed on your system like this:
    whereis php5

    If you post the outputs here we can try to help.
    :)
     
    Last edited: Sep 24, 2011
  12. conductive

    conductive Member

    CSsab,

    As you know things are never what they seem to be and I am sure in some way you are correct. I have been down for way too long and would have not attempted this project if I knew that it would be this involved.

    On the flip side ispconfig has more different CGI options than I bargained for and even on a simple LAMP you need to add apache directives to parse PHP. Since I do not know how to determine their existence and configure does not tell me where they are or not I still feel that there is a problem here. I also feel that if I do have a PHP issue I should be getting some type of depreciated error.

    I also parse html as php and that will most certainly need manual configuration. I can also say that if I want to use index.php I will need to make a manual change for that too. Unfortunately this information is no where to be found in the 300 pages and it is clear that ispconfig is not as plug and play as people would make you believe.

    the php files are simply in /etc/ not /etc/php5 so that was not a big concern except for the fact that their are several php.ini's and from what I hear I am not supposed to play with them since it will interfere with ispconfig.

    I just did a fresh load and I will clear any build errors and see how it goes. If that does not work I will try something that is not as complex.

    Does anybody know how to find out what directives apache is using?
     
    Last edited: Sep 24, 2011
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    Ispconfig just writes a simple vhost file. You can find itin the sites enabled folder and it contains all directives.

    There are no additional directives required and as cssab pointed out, your issues are php issues and not ispconfig issues.

    The recommended linux distribution for ispconfig is debian 6. So you might want to use that for your server. The debian package installer apt does a better job then yum from centos when it comes to package configuration and dependency checks. For that reason, debian systems are much easier zo install and maintain then centos systems. And debuan has all packages in its main repository, so you dont get the dependency problems that you often see on centos servers during updates.
     
    Last edited: Sep 24, 2011
  14. CSsab

    CSsab New Member

    Lets see how you go with this new install - hopefully your first try was a simple misconfiguration.

    If all goes well then try adding a site and selecting the php options in the dashboard. You can add your own apache directives there also and view them in the .htaccess in the root folder of your new site. EG: your first site would be /var/www/clients/client1/web1/web/.htaccess - that directory is the "back end" if you like of that new website so if you change the index in there it is changed automatically on the /var/www directory (centos might have a slightly different directory structure but the idea is the same)

    Better not to mess around with the default vhost like you say even though ISPConfig uses it's own vhost.

    Good luck with it - can be a bit of a learning curve initially but when you realize how much work ISPConfig does for you - you'll be happier.
     
  15. CSsab

    CSsab New Member

    Sorry I didn't see your post till ..
    I agree with the Debian idea because of course I think Debian all the way and it is easier to help someone who is using the same OS.
    :)
     
  16. conductive

    conductive Member

    Since I was not getting any apache errors and taking into consideration what has been said I started looking at PHP code. To make things simple I tried the following script.

    <?php
    include("noFileExistsHere.php");
    echo "Hello World!";
    ?>

    It did not produce any error just "Hello World!"
    As expected require did not produce any input.

    It appears that I very well could be experiencing a problem reading my included files and/or providing the proper path to them. As it stands I still do not have the proper error output but feel I have isolated the issue.

    Does anybody have an idea on how to get the error that will show the attempted path or other configuration require to use include files?

    ---------------------
    I turned on error reporting in the php.ini and I did receive a reasonable error

    Warning: require(noFileExistsHere.php): failed to open stream: No such file or directory in /var/www/clients/client1/web1/web/testobj.php on line 2 Fatal error: require(): Failed opening required 'noFileExistsHere.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/clients/client1/web1/web/testobj.php on line 2

    I do not know why my page.inc.php files are not working, but I wonder if the include path should be modified so that it can find the base directory of my site.
     
    Last edited: Sep 27, 2011
  17. cbj4074

    cbj4074 Member

    Adding the base directory of your site to PHP's include path seems unnecessary. Do you really want to modify PHP's include path every time you create a new site?

    Why not define the path to your site as a PHP constant, e.g.,

    Code:
    <?php
    
    define('PATH_TO_SITE_ROOT', '/var/www/example.com/');
    
    and then include additional PHP files using the defined constant, e.g.,

    Code:
    <?php
    
    require(PATH_TO_SITE_ROOT . 'my-includes/foo.inc.php');
    
    Specifically, what error message is logged (or displayed) at this point when you try to include a file to no avail?
     
  18. conductive

    conductive Member

    Thanks for the information and good clue.

    No I do not want to define paths if I can help it but at this point I just want to make it work and will do anything to see it work.

    for some reason I am getting "/ parsed out literally. It appears that some of my links were escaped before but were not literally interpreted. I have played with the magic quotes on and off but it does not matter.

    So at this point I am thinking that for whatever reason I have some "/ and or / that are messing me up.

    I was going to try an example from a php mysql development book but the cd was broken.

    /var/www/example.com/ did not work either.
     
  19. conductive

    conductive Member

    The following example code from a PHP4 mysql development manual.
    My PHP5 is broken.

    <?
    require("header.inc");
    ?>
    <!-- page content -->
    <p>Welcome to the home of TLA Consulting.
    Please take some time to get to know us.</p>
    <p>We specialize in serving your business needs
    and hope to hear from you soon.</p>
    <?
    require("footer.inc");
    ?>

    Produces the following output.
    --------------
    Welcome to the home of TLA Consulting. Please take some time to get to know us.

    We specialize in serving your business needs and hope to hear from you soon.
    ------------------
    Output source is similar to the code above.

    The header and footer came up perfectly with html example.

    PHP does not parse properly.
    ISPconfig3 does not configure everything.
    20,000 users do not use PHP or have made a modification.

    Does anybody know that modification was made?
     
  20. conductive

    conductive Member

    I just verified that the PHP4 and PHP5 code are the same.

    Do any of these servers work?

    Is there any guarantee that the Debian will work?

    Any Service notes?
     

Share This Page