Solved (FAMP) Stack problem on webserver

Vincent See

Member

Reaction score: 3
Messages: 73

Hello FreeBSD! I am making a webserver for our small business and chose FreeBSD because it has ZFS and I'm a fan of pfSense and started to use FreeBSD.

I installed FAMP ( Apache 2.4, MySQL 5.6, and PHP 5.6) on my FreeBSD. I installed Inoerp and weberp but it only shows a blank page or server error 500. The only thing I got to work is Wordpress. But I need an ERP system.

I also tried it on windows and mac, I installed xampp, and it worked immediately.
The requirements for Inoerp is:
  1. HTTP web server Ex. Nginx, Apache, IIS, Oracle HTTP
  2. PHP 5.5+
  3. MySQL(Server version: 5.6.17+) or MariaDB
for weberp:
  • PHP a versions later than 5.1
  • MySQL version 4.3 or above - innodb transaction compliant tables are required
Can anyone shed light on why is there's only a blank page appearing or server error 500?
I really like FreeBSD, and hope to implement it here.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,682
Messages: 30,622

Check /var/log/apache_error.log. It's usually a configuration error.
 
OP
OP
Vincent See

Vincent See

Member

Reaction score: 3
Messages: 73

I checked /var/log/httpd-error.log and found

Code:
[Sat Dec 19 10:24:00.415990 2015] [:error] [pid 894] [client 192.168.1.101:50675] PHP Notice:  Undefined variable: _SESSION in /usr/local/www/apache24/data/inoerp/includes/functions/loader.inc on line 38
[Sat Dec 19 10:24:00.417515 2015] [:error] [pid 894] [client 192.168.1.101:50675] PHP Notice:  Undefined index: default_theme in /usr/local/www/apache24/data/inoerp/includes/functions/loader.inc on line 84
[Sat Dec 19 10:24:00.418477 2015] [:error] [pid 894] [client 192.168.1.101:50675] PHP Warning:  include_once(/usr/local/www/apache24/data/inoerp/themes//home_page_template.php): failed to open stream: No such file or directory in /usr/local/www/apache24/data/inoerp/index.php on line 53
[Sat Dec 19 10:24:00.418744 2015] [:error] [pid 894] [client 192.168.1.101:50675] PHP Warning:  include_once(): Failed opening '/usr/local/www/apache24/data/inoerp/themes//home_page_template.php' for inclusion (include_path='.:/usr/local/share/pear') in /usr/local/www/apache24/data/inoerp/index.php on line 53
I tried comparing the files on my FreeBSD /usr/local/www/apache24/data/inoerp and Windows inoerp folder and it's the same.

Thank you SirDice!
 
Last edited by a moderator:
OP
OP
Vincent See

Vincent See

Member

Reaction score: 3
Messages: 73

I checked /var/log/httpd-error.log and found

Code:
[Sat Dec 19 10:24:00.415990 2015] [:error] [pid 894] [client 192.168.1.101:50675] PHP Notice:  Undefined variable: _SESSION in /usr/local/www/apache24/data/inoerp/includes/functions/loader.inc on line 38
[Sat Dec 19 10:24:00.417515 2015] [:error] [pid 894] [client 192.168.1.101:50675] PHP Notice:  Undefined index: default_theme in /usr/local/www/apache24/data/inoerp/includes/functions/loader.inc on line 84
[Sat Dec 19 10:24:00.418477 2015] [:error] [pid 894] [client 192.168.1.101:50675] PHP Warning:  include_once(/usr/local/www/apache24/data/inoerp/themes//home_page_template.php): failed to open stream: No such file or directory in /usr/local/www/apache24/data/inoerp/index.php on line 53
[Sat Dec 19 10:24:00.418744 2015] [:error] [pid 894] [client 192.168.1.101:50675] PHP Warning:  include_once(): Failed opening '/usr/local/www/apache24/data/inoerp/themes//home_page_template.php' for inclusion (include_path='.:/usr/local/share/pear') in /usr/local/www/apache24/data/inoerp/index.php on line 53
I tried comparing the files on my FreeBSD /usr/local/www/apache24/data/inoerp and Windows inoerp folder and it's the same.

Thank you SirDice!
I got the page to load by installing pkg install php56-session.

All the previous error is gone, but a new error appeared in /var/log/httpd-error.log which is
Code:
PHP:  syntax error, unexpected '=' in /usr/local/etc/php/extensions.ini on line 22
Anyone know how to fix this? The page is showing but it's not working.
 
Last edited by a moderator:
OP
OP
Vincent See

Vincent See

Member

Reaction score: 3
Messages: 73

my /usr/local/etc/php/extensions.ini contains
Code:
extension=mysql.so
extension=mysqli.so
extension=gettext.so
extension=bcmath.so
extension=bz2.so
extension=xml.so
extension=dom.so
extension=xsl.so
extension=zip.so
extension=zlib.so
extension=hash.so
extension=gd.so
extension=curl.so
extension=tokenizer.so
extension=pdo.so
extension=pdo_dblib.so
extension=pdo_firebird.so
extension=pdo_mysql.so
extension=pdo_odbc.so
extension=pdo_pgsql.so
extension=pdo_sqlite.so
extension=xmlreader.so
extension=ctype.so
extension=iconv.so
extension=filter.so
zend_extension=/usr/local/lib/php/20131226/opcache.so
extension=posix.so
extension=simplexml.so
extension=sqlite3.so
extension=xmlwriter.so
extension=json.so
extension=phar.so
I don't see anything wrong in line 22 which is extension=xmlreader.so. Do I need to install something to make it work?
 
OP
OP
Vincent See

Vincent See

Member

Reaction score: 3
Messages: 73

I restarted freebsdFreeBSD and the previous error is gone and a new one appeared. I think this is related to my login problem. Anyone know what does the error mean? I think there is something that I didn't install to get this error.

Code:
[Sat Dec 19 17:53:28.562939 2015] [:error] [pid 850] [client 192.168.1.101:52821] PHP Notice:  Trying to get property of non-object in /usr/local/www/apache24/data/inoerp/extensions/user/class.user.inc on line 152, referer: http://192.168.1.150/inoerp/extensions/user/user_login.php
[Sat Dec 19 17:53:28.567114 2015] [:error] [pid 850] [client 192.168.1.101:52821] PHP Notice:  Trying to get property of non-object in /usr/local/www/apache24/data/inoerp/extensions/user/class.user.inc on line 152, referer: http://192.168.1.150/inoerp/extensions/user/user_login.php
[Sat Dec 19 17:53:29.115668 2015] [:error] [pid 850] [client 192.168.1.101:52821] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/www/apache24/data/inoerp/includes/basics/json.basics.php on line 97, referer: http://192.168.1.150/inoerp/extensions/user/user_login.php
 

H Hu

New Member


Messages: 1

I'm replying this message just to have a central location for inoERP on FreeBSD
===================================================
I would like to share my experience of install inoERP 0.6.1 on FreeBSD 11 so that hopefully you won't run into the troubles that I had. Be aware that the following is the minimum that I had to do to get it going.

If you ask me if it is worth all the efforts, my answer is No.

I. Set up FAMP (FreeBSD, Apache, mysql and php) stack

1. update currently installed packages
# pkg upgrade

2. Install apache24: # pkg install apache24
enable apache as a service: # sysrc apache24_enable=yes
start apache service: # service apache24 start

After this step, you can test apache server by typing the URL in the web browswer and see the default web page.

3. Install mysql server: # pkg install mysql56-server
copy my.cnf file: under /usr/local/etc/mysql, copy my.cnf.sample to my.cnf
enable mysql as a service: # sysrc mysql_enable=yes
start mysql service: # service mysql-server start
run security script: # mysql_secure_installation
root password: ****
remove anonymous users: yes
disallow root login remotely: yes
Remove test database and access to it: yes
Reload privilege tables: yes"

4. Install PHP: # pkg install mod_php71 php71 php71-mysqli php71-pdo php71-pdo_mysql php71-gettext php71-session
Note: some of the above packages, although not mentioned in their guide, are required to run inoERP properly
copy the sample PHP configuration file into place: in /usr/local/etc, copy php.ini-production to php.ini
regenerate the system's cached information about your installed executable files: # rehash

5. Change apache configration: in /usr/local/etc/apache24/httpd.conf
Look for the following lines and make sure no # at the beginning of the lines.
LoadModule rewrite_module modules/mod_rewrite.so for clean URL
LoadModule php7_module libexec/apache24/libphp7.so
Add or change the following lines:
<IfModule dir_module>
DirectoryIndex index.php index.html"

"<FilesMatch ""\.php$"">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ""\.phps$"">
SetHandler application/x-httpd-php-source
</FilesMatch>"

restart apache service # service apache24 restart
create a file called phpinfo.php with the following line
<?php phpinfo(); ?>"

Type [URL]http://yourserver/phpinfo.php[/URL], you'll see all the php information. By now, the FAMP stack is completed.

II. Install inoERP
1. Download inoERP-0.6.1.tar.gz
extract: tar xf inoERP-0.6.1.tar.gz
You'll see a folder "inoerp"
move inoerp folder under www (this is where I put it. you can pick your own preferred location), so you have
/usr/local/www/inoerp

2. Change owner and group of inoerp folder. In /usr/local/www
# chown -R www:www inoerp
Change the permissions of several things: In /usr/local/www/inoerp
# chmod 777 .htaccess files install.php includes/basics/settings/dbsettings.php

3. Change apache configuration at /usr/local/etc/apache24/httpd.conf so that you'll have
DocumentRoot "/usr/local/www/inoerp"
<Directory "/usr/local/www/inoerp">
Restart apache service: service apache24 restart

4. Set up mysql database:
# mysql -u root -p
mysql> create database inodb;
mysql> grant all on inodb.* to 'inouser'@'localhost' identified by 'inopass';
mysql> flush privileges;
mysql> exit;"

5. In web browser, type the URL of your server to start the installation of inoERP
You'll see
a table of prerequistes (note: php71-session is not listed by required.)
After clicking continue, you need to input the information of the database such as dabase name,user and password.
After clicking continue, the installation starts at 0% and finishes at 100%
You'll see some warning after installation
Make sure that the write access from inlcudes directory, basics directory, .htaccess file and dbsettings are removed
Check/fix the above permissions

6. Type the URL of the server in web browswer, you'll see the inoERP web page.
 
Top