Headers already sent

Hi, trying to install SuiteCRM, I get SuiteCRM 7.1 was installed sucesfully, and after next page I get

Warning: Cannot modify header information - headers already sent by (output started at /home/www/domain/domains/mydomain/subdomains/act/include/SugarEmailAddress/SugarEmailAddress.php:1110) in /home/www/domain/domains/mydomain/subdomains/act/install/complete_install.php on line 4

When I try to access the installed suite, I get another headers already sent message.

I know this error usually means there’s a blank space/line before the opening/closing php tags in some file, but have no idea in which file…

Any ideas what to do?
Thanks

line 4 in complete_install.php header(‘Location: index.php?module=Users&action=Login’); is trying to open login page so - Users or Administration folder (uncluding custom and cache folders)
So u can try to look there
It might be language files english en_us or your local language files in mentioned folders

Thanks, looked into the folders and found bunch of files that had whitespace after the closing php tag. Still, my issue is not resolved. When trying to login, I get

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/www/domain/domains/mydomain/subdomains/act/include/SugarEmailAddress/SugarEmailAddress.php:1110) in /home/www/domain/domains/mydomain/subdomains/act/include/MVC/SugarApplication.php on line 594

I also tried to re-upload all the files, no luck…
Any ideas?

I found this a script that searches for files with leadin/trailing spaces,

http://www.findnwrite.com/musings/script-for-removing-blank-spaces-before-and-after-php-tags/

and there’s A LOT of files across all the modules! Anyone knows how to fix that, please?

What type of host are you using?
Is it a local install on a computer using a WAMP XAMPP type install or a Hosted service?

I’m on shared hosting. I run there multiple instances of Wordpress, Joomla and Prestashop for different domains, with no problems…

So you uploaded the File by FTP? What FTP client did you use and did you set it to upload binary and not Auto?

If you’re running WP and Joomla it should work fine so I would try what I suggested above.

Used Filezilla with binary mode, tried WinSCP also - still no luck… :frowning:

What version of PHP is your host using?

Also delete the old file and re-upload… do not overwrite.
Upload them with Binary
re-run your install
if it happens again check the config.php file for extra spaces and erroneous characters.

Tried that - deleted all the files, reuploaded with binary mode, went thru install, and got the same error. There is nothing strange in config.php, no extra spaces, no strange lines…

PHP Version?
What mods are installed?
What is the actual error you get when trying to access the SuiteCRM install?

Php 5.4
Mods of php: Core,date,ereg,libxml,openssl,pcre,sqlite3,zlib,bcmath,bz2,calendar,ctype,curl,dba,dom,hash,fileinfo,filter,ftp,gd,gettext,gmp,SPL,iconv,session,json,ldap,mbstring,mcrypt,mssql,standard,mysqlnd,mysqli,pcntl,mysql,PDO,pdo_dblib,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,Reflection,imap,SimpleXML,soap,sockets,exif,tidy,tokenizer,xml,xmlreader,xmlrpc,xmlwriter,zip,cgi-fcgi,imagick,mhash,ionCube Loader

What I see on the screen when trying to access SuiteCRM:


Strict Standards: Declaration of SugarEmailAddress::save() should be compatible with SugarBean::save($check_notify = false) in /home/www/domain.com/domains/domain/subdomains/act/include/SugarEmailAddress/SugarEmailAddress.php on line 1110

Strict Standards: Declaration of Person::create_export_query() should be compatible with SugarBean::create_export_query($order_by, $where) in /home/www/domain.com/domains/domain/subdomains/act/include/SugarObjects/templates/person/Person.php on line 41

Strict Standards: Declaration of User::retrieve() should be compatible with Person::retrieve($id = -1, $encode = true, $deleted = true) in /home/www/domain.com/domains/domain/subdomains/act/modules/Users/User.php on line 41

Strict Standards: Declaration of User::create_export_query() should be compatible with Person::create_export_query(&$order_by, &$where, $relate_link_join = '') in /home/www/domain.com/domains/domain/subdomains/act/modules/Users/User.php on line 41

Strict Standards: Declaration of User::create_new_list_query() should be compatible with SugarBean::create_new_list_query($order_by, $where, $filter = Array, $params = Array, $show_deleted = 0, $join_type = '', $return_array = false, $parentbean = NULL, $singleSelect = false, $ifListForExport = false) in /home/www/domain.com/domains/domain/subdomains/act/modules/Users/User.php on line 41

Strict Standards: Declaration of User::list_view_parse_additional_sections() should be compatible with SugarBean::list_view_parse_additional_sections(&$list_form) in /home/www/domain.com/domains/domain/subdomains/act/modules/Users/User.php on line 41

Strict Standards: Declaration of Currency::retrieve() should be compatible with SugarBean::retrieve($id = -1, $encode = true, $deleted = true) in /home/www/domain.com/domains/domain/subdomains/act/modules/Currencies/Currency.php on line 236

Strict Standards: Non-static method UploadStream::register() should not be called statically in /home/www/domain.com/domains/domain/subdomains/act/include/entryPoint.php on line 181

Strict Standards: Non-static method SugarConfig::getInstance() should not be called statically, assuming $this from incompatible context in /home/www/domain.com/domains/domain/subdomains/act/include/SugarLogger/LoggerManager.php on line 73

Strict Standards: Non-static method SugarConfig::getInstance() should not be called statically, assuming $this from incompatible context in /home/www/domain.com/domains/domain/subdomains/act/include/SugarLogger/SugarLogger.php on line 118

Strict Standards: Declaration of MysqlManager::checkQuery() should be compatible with DBManager::checkQuery($sql, $object_name = false) in /home/www/domain.com/domains/domain/subdomains/act/include/database/MysqlManager.php on line 1497

Strict Standards: Non-static method LogicHook::initialize() should not be called statically in /home/www/domain.com/domains/domain/subdomains/act/include/entryPoint.php on line 236

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/www/domain.com/domains/domain/subdomains/act/include/SugarEmailAddress/SugarEmailAddress.php:1110) in /home/www/domain.com/domains/domain/subdomains/act/include/MVC/SugarApplication.php on line 594

Strict Standards: Non-static method LogicHook::initialize() should not be called statically, assuming $this from incompatible context in /home/www/domain.com/domains/domain/subdomains/act/include/MVC/SugarApplication.php on line 611

Warning: Cannot modify header information - headers already sent by (output started at /home/www/domain.com/domains/domain/subdomains/act/include/SugarEmailAddress/SugarEmailAddress.php:1110) in /home/www/domain.com/domains/domain/subdomains/act/include/utils.php on line 2695

Strict Standards: Non-static method ControllerFactory::getController() should not be called statically, assuming $this from incompatible context in /home/www/domain.com/domains/domain/subdomains/act/include/MVC/SugarApplication.php on line 71

Strict Standards: Non-static method LogicHook::initialize() should not be called statically in /home/www/domain.com/domains/domain/subdomains/act/include/utils.php on line 3014

Strict Standards: Non-static method Tracker::logPage() should not be called statically in /home/www/domain.com/domains/domain/subdomains/act/include/utils.php on line 3025

Strict Standards: Non-static method SugarConfig::getInstance() should not be called statically in /home/www/domain.com/domains/domain/subdomains/act/include/utils/sugar_file_utils.php on line 362

Turn off strict warnings
http://stackoverflow.com/questions/1248952/php-5-disable-strict-standards-error

If you cannot edit your PHP.ini config from your host you can use the part in the stackoverflow link to edit your .htaccess file in root folder.

You probably already have the entries there you just need to ununcomment the right one

My .htaccess looks

# BEGIN SUGARCRM RESTRICTIONS
RedirectMatch 403 .*\.log$
RedirectMatch 403 /+not_imported_.*\.txt
RedirectMatch 403 /+(soap|cache|xtemplate|data|examples|include|log4php|metadata|modules)/+.*\.(php|tpl)
RedirectMatch 403 /+emailmandelivery\.php
RedirectMatch 403 /+upload
RedirectMatch 403 /+custom/+blowfish
RedirectMatch 403 /+cache/+diagnostic
RedirectMatch 403 /+files\.md5$
# END SUGARCRM RESTRICTIONS
<FilesMatch "\.(jpg|png|gif|js|css|ico)$">
        <IfModule mod_headers.c>
                Header set ETag ""
                Header set Cache-Control "max-age=2592000"
                Header set Expires "01 Jan 2112 00:00:00 GMT"
        </IfModule>
</FilesMatch>
<IfModule mod_expires.c>
        ExpiresByType text/css "access plus 1 month"
        ExpiresByType text/javascript "access plus 1 month"
        ExpiresByType application/x-javascript "access plus 1 month"
        ExpiresByType image/gif "access plus 1 month"
        ExpiresByType image/jpg "access plus 1 month"
        ExpiresByType image/png "access plus 1 month"
</IfModule>

when I put in there

php_flag display_errors off

I get Server 500 internal server error…

remove that line…
Try this

php_value error_reporting 30711

This is the E_ALL value (32767) and the removing the E_STRICT (2048) and E_NOTICE (8) values.

Otherwise do you have a php.ini in your root folder?

change

error_reporting = E_ALL

to

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT

If you don’t have access to the .htaccess file or it’s not enabled, you’ll probably need to put this at the top of the PHP section of any script that gets loaded from a browser call:

error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE);

One of those should help you be able to use the software. The notices and strict stuff are indicators of problems or potential problems though and you may find some of the code is not working correctly in PHP 5.4.

Tried that line, still server 500 error.

I have no php.ini in root folder and have no access to it.

I also tried to set php to version 5.2, still no luck…

Got it - I turned off php error display in the domain administration, and I’m able to login!

do you have access to your error logs…
what is the server reporting there?
maybe a memory limit issue?

1 Like