CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Help with installation, PHP error
Pages: [1]

Author Topic: Help with installation, PHP error  (Read 2645 times)

joshathedone

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 0
  • CiviCRM version: Civicrm4
  • CMS version: Drupal 7
  • MySQL version: 5.1.41
  • PHP version: 5
Help with installation, PHP error
May 12, 2011, 02:51:11 pm
I am attempting to move my website off of my local machine onto our live server.  I have no problems with the drupal installation and migration.  However, every time I attempt to migrate civicrm as soon as I enable the module the entire site crashes.  I have tried both the clean installation method detailed on this site, as well as just copying the files, changing civicrm.settings.php, and importing the mysql file.  Everything I get the same error in my nginx logs, something like:

2011/05/12 21:34:05 [error] 9817#0: *21 FastCGI sent in stderr: "PHP Warning:  htmlspecialchars(): Invalid multibyte sequence in argument in /var/www/hedone.us/includes/bootstrap.inc on line 1476
PHP Fatal error:  require_once(): Failed opening required 'civicrm_user.inc' (include_path='.:/usr/share/php:/usr/share/pear') in ÷A«Ò/www/hedone.us/sites/all/modules/civicrm/drupal/civicrm.module on line 30" while reading response header from upstream, client: 69.143.255.73, server: hedone.us, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "hedone.us"

The only difference is the characters in front of the file path change seemingly at random.  I am assuming they have something to do with the problem, but can't for the life of me figure out where they are coming from.

Any assistance would be appreciated.


 

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Help with installation, PHP error
May 12, 2011, 03:49:13 pm
Quote from: joshathedone on May 12, 2011, 02:51:11 pm
2011/05/12 21:34:05 [error] 9817#0: *21 FastCGI sent in stderr: "PHP Warning: 

When PHP is run as a CGI, I found that you must have a php.ini in every dir that has a .php file in it.

I whipped up a script to propagate symlinks to the php.ini file in the /www/ directory of the site. That way we have only one master php.ini to maintain per site. The script scans the subtree for *.php, if it is a new directory (one that has not been confirmed yet) it checks for a symlink named php.ini, if it is not found then it creates one, then adds the current directory to a hash of confirmed directories.

Perhaps you are getting bit by php settings not being correct. Such was the solution long ago for us.
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

joshathedone

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 0
  • CiviCRM version: Civicrm4
  • CMS version: Drupal 7
  • MySQL version: 5.1.41
  • PHP version: 5
Re: Help with installation, PHP error
May 13, 2011, 10:23:03 am
@mdlueck

Thanks! Seems you were right.  This is my first time setting up a server stack on a VPS from scratch. All of my php.ini settings were at the default.  I adjusted the include_path and it seems to have fixed the problems for now.

Can anyone suggest what settings in the php.ini I should adjust to run civicrm effectively?

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Help with installation, PHP error
May 13, 2011, 01:12:07 pm
@joshathedone

Must you run with PHP as a CGI, or can you install the Apache mod version?

I arrived at settings which work well for both Drupal and Gallery. CiviCRM did not require any further adjustments.

Here is what I have in php.ini in a server that also runs php as a cgi:

Code: [Select]
;Equiv of .htaccess that Drupal provided
magic_quotes_gpc = 0
register_globals = 0
session.auto_start = 0
mbstring.http_input = pass
mbstring.http_output = pass
mbstring.encoding_translation = 0

;Per http://gallery.menalto.com/node/68598
session.save_handler = files
allow_call_time_pass_reference = Off

;Per http://www.alphaone-tech.com/tech-support/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=70
;register_globals = 0
track_vars = 1
short_open_tag = 1
;magic_quotes_gpc = 0
magic_quotes_runtime = 0
magic_quotes_sybase = 0
arg_separator.output = "&"
session.cache_expire = 200000
session.gc_maxlifetime = 200000
session.cookie_lifetime = 604800
;session.auto_start = 0
;session.save_handler = user
session.cache_limiter = none
;allow_call_time_pass_reference = On

#Adjusted error handling per http://www.cyberciti.biz/tips/php-howto-turn-on-error-log-file.html
#And also https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/512167  #3 comment
display_errors = Off
error_log = /var/log/php5/domainxyz.com.php_error.log
log_errors = On
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

Larry Jones

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 4.0
  • CMS version: Drupal
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Help with installation, PHP error
May 13, 2011, 01:14:39 pm
"Can anyone suggest what settings in the php.ini I should adjust to run civicrm effectively?"

Best starting point is the supplied php.ini. It's a long, well documented file (38 kB, 1140 lines), with lots of tips.  From the opening:
"By default, PHP installs itself with a configuration suitable for development purposes, and NOT for production purposes..."

If you want to be safe, read the file, follow the tips.  You can also google "tuning php.ini" but that's not always safe.  With that warning, here are some changes that made sense to me:

short_open_tag = Off
allow_call_time_pass_reference = Off
display_errors = Off
log_errors_max_len = 1024
variables_order = "GPCS"
register_long_arrays = Off
register_argc_argv = Off
auto_globals_jit = On
session.bug_compat_42 = Off
session.bug_compat_warn = 1
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"

joshathedone

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 0
  • CiviCRM version: Civicrm4
  • CMS version: Drupal 7
  • MySQL version: 5.1.41
  • PHP version: 5
Re: Help with installation, PHP error
May 14, 2011, 05:05:43 pm
Thanks everyone.  After fixing the problems through forcing the include_path to the correct place for civicrm  I started encountering problems in other portions of the site.  Messed with all kinds of setting sin php.ini to no avail.

Turns out this is a bug in the latest version of APC that causes random characters in front of the file paths on certain server configurations.  Disabled APC and everything is fine (though slow).  Looks like they are working on a patch to fix the problem.

http://pecl.php.net/bugs/bug.php?id=22687

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Help with installation, PHP error

This forum was archived on 2017-11-26.