SuiteCRM No Log File being written

I have an odd problem. My SuiteCRM instance works quite well I have a few unresolved issues which are

AOD Global Search not functioning - Lucene Job & Index seem to be working
Home Page - has a facebook Connector error - Undefined Index

but at the moment the most frustrating is that fact that SuiteCRM is not writing any Log Files.
All the settings are correct but it is not writing any logs regardless of whether set to fatal or Info or Debug

This possibly suggests a permissions problem but I have it all set as recommended. Any suggestions?

A little hard to debug without system information, i.e. lamp with/without shell access etc.

Have you (or someone else) changed the path in the config.php file (in the root of your SuiteCRM install) for the log file?
If so it’s rgw logfile will not be in the SuiteCRM directory but it will be somewhere :wink: else, for example mine is in /var/log/suitcrm/suitecrm.log:


 'log_dir' => '/var/log/suitecrm',
  'log_file' => 'suitecrm.log',

Are you sure that the root/base directory of your SuiteCRM has write access by the owner of the webserver?
If not, it will not be able to create the file … if its there is will be allowed to append.

So you could create the file in the root of the SuiteCRM, make it writeable by the server user, this could do the trick

Again, little hard without knowledge what your system config is.

Jobst

1 Like

Hi Jobst

Thanks for the help.

I checked my config.php and I also did a full search of the server and teh files are not in a different directory.

I am running a Centos6 server I have SSH access as root.

I believe that it is a permissions issue, as I have had to make some directories 777 to be writeable even though the recommendation is 775.

My Suitecrm Directory is -R apache:apache

Any suggestions are appreciated

Hi

I run a variety of CENTOS versions, but all of them have Apache, Mysql/Maria, php.

775 is not neccessary - in true Unix terms this actually creates a security issue because other processes can read files owned by the webserver - I know people will tell me that I am wrong and/or this is overly paranoid but I have a proven track record. I can tell you too, that ALL of my websites have the same chmod/chown (joomla,wordpress,own written, suitecrm etc)

This is what I do (SUITECRM your crm directory)


find SUITECRM -type d -exec chmod 6770 {} \;
find SUITECRM -type f -exec chmod 0660 {} \;
chmod -R apache.apache SUITECRM

The 6 when finding directories makes sure that the permissions are properly set upon file creation.

Please try to “su - apache”, then “cd SUITECRM”, then “touch testfile”.
You might have to change the setting in the /etc/passwd from


apache:x:48:48:Apache:/var/apache:/sbin/nologin

to


apache:x:48:48:Apache:/var/apache:/bin/bash

before you can “su” , but if the file is created successfully then it is NOT a permission problem.
Make sure you change the passwd file back to nologin.

Also make sure the the root of the webserver is writeable by the process owner of the webserver.
Also make sure you set the path setting for the log file in the config.php to a know spot, and that you can write as apache to that file, i.e.


echo "blah" >> PATH_TO_LOGFILE/suitecrm.log

Let me know how you go …

Jobst

Hi

Thanks for all the help.

find SUITECRM -type d -exec chmod 6770 {} ; - Completed succesfully
find SUITECRM -type f -exec chmod 0660 {} ; - Completed succesfully
chmod -R apache.apache SUITECRM - when I chmod it says “Invalid Mode” - isn’t this supposed to be chown?

“touch testfile” works perfectly from my root login
something odd is that when I
su - apache

I get the following result
“This account is currently not available”

suitecrm.log is still not being created

Hi

This ia what I meant change “/sbin/nologin” to “/bin/bash” in “/etc/passwd”.

It could also be

  • /bin/false
  • /dev/null
  • /sbin/nologin
  • or an “!” in the password field (see man passwd)

see https://www.digitalocean.com/community/tutorials/how-to-restrict-log-in-capabilities-of-users-on-ubuntu for reasons.

jobst

OK - thanks got all that.
su - apache worked after changing passwd from sbin/nologin to bin/bash
touch testfile worked

reset bin/bash to sbin/login

and now

I get a blank screen when I login to Suitecrm with this "No input file specified. "

Any ideas?

Should be (no quoates) “/sbin/nologin”, e.g.


apache:x:48:48:Apache:/var/apache:/sbin/nologin

and restart apache “/etc/init.d/httpd restart”

As for the “no input file specified”, that is a php error, there were a few versions of PHP that did not like some .htaccess setups.
I do not know what version you have but I do not run the standard PHP versions provided by CENTOS, I get mine from webtatic/remi/others as RedHat does not like to be up-to-date with the PHP version and they say “CentOS could become unstable if using on the edge PHP versions”. I also get my maria/mysql from there.

Could be related to false content in .htaccess (e.g. rewritebase), sometimes this helps:


RewriteEngine On
RewriteBase /SUITECRMSUBDIRECTORY/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

SuiteCRM and SugarCRM .htacess files do not specify the last line (which in most cases is fine) but sometimes it does not.
Also important is to try to put the subdirectory of the suitcrm install into the base …

Just check out the lengthy discussion on the net (google ‘apache no input file specified’ or ‘php no input file specified’) and even on stackoverflow about this issue … its not only suitecrm, but joomla/wordpress/others CAN all be subject to this error.

Jobst

In my instance log is written but some log is missing for some random dates, and some log file size not as per config, in config i set log file size 10 mb but some log file is 1kb.