web-erp help needed.

Discussion regarding the installation and configuration of Linux distributions.
Post Reply
spawnisalive
Lance Naik
Posts: 30
Joined: Tue Sep 16, 2003 8:21 pm
Location: Karachi
Contact:

web-erp help needed.

Post by spawnisalive »

sallam ppl,
i am using mendrake 9 on PIII intel 810 board 256mb ram
what i have done is that:
1) i have made erp folder in /var/www/html so now my folder where i copied web-erp file is at this location /var/www/html/erp
2)i have sucessfully run web-erp-new.sql which has created the database without any problum.

now the problum is that when i type https://192.168.0.2/erp/index.php in address bar following message shows up:
Fatal error: Call to undefined function: mysql_connect() in /var/www/html/erp/includes/ConnectDB.inc on line 3

what else i have to do to make it run.
spawnisalive
Lance Naik
Posts: 30
Joined: Tue Sep 16, 2003 8:21 pm
Location: Karachi
Contact:

Post by spawnisalive »

one more thingi did't mention i have edited the config.php.
jargon
Lieutenant Colonel
Posts: 691
Joined: Mon Oct 13, 2003 9:40 am

Post by jargon »

ok.. I was about to say.

Assuming that you have edited the config.php and you have placed the correct dbname , username, password, and made sure that you can connect to the database from a standard console terminal, with the command : mysql -uroot -ppassword dbname (notice that there is no space between the '-u' & 'root'

Check the file that is included in the error message, perhaps post it here if its not very long.
I'm curious as whats in that .inc file.
jargon
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear spawnisalive,
Salam,

Did You Allow Access 192.168.0.1 in your MySQL Db ?

bash# mysql --user=root mysql

mysql> GRANT ALL PRIVILEGES ON *.* TO root@localhost
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO root@'%'
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO user@192.168.0.1
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO user@'%'
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;

Or php is missing mysql support for Red Hat you need to install the php-mysql rpm for Mandrak Check out the following link or recompile PHP with --with-mysql option http://www.phpbuilder.com/mail/php-inst ... 1/0019.php

Best Regards.
Farrukh Ahmed
jargon
Lieutenant Colonel
Posts: 691
Joined: Mon Oct 13, 2003 9:40 am

Post by jargon »

Just a side note:

If you want to know if there is mysql support in your copy of php.

create a file called 'test.php' and place the following code into it

<?php phpinfo(); ?>

, then dump the file into the DocumentRoot for Apache and do,

http://192.168.0.1/test.php
jargon
spawnisalive
Lance Naik
Posts: 30
Joined: Tue Sep 16, 2003 8:21 pm
Location: Karachi
Contact:

Post by spawnisalive »

sallam ppl,
thank u all for ur reply ok to ans ur questions
Jargon: php is working fine i tried <?php phpinfo(); ?> and it's php is working.

LinuxFreak: i m using webmin for mostof my linux configuration of apache and mysql, i have made a user for mysql database which i have tested. the user can connect to mysql database from console terminal

here goes the config.php file:

<?php
/*--------------------------------------------------\
| | | config.php |
|---------------------------------------------------|
| Web-ERP - http://web-erp.sourceforge.net |
| by Logic Works Ltd |
|---------------------------------------------------|
| |
\--------------------------------------------------*/

// User configurable variables
//---------------------------------------------------

// Application version
$Version = "0.2.3";

// The company name to appear in the headings on each page displayed
$CompanyName = "Evian Fats & Oils (Pvt.) Ltd. Demo ERP " . $Version;

// The default date format for entry of dates and display
// $DefaultDateFormat = "d/m/Y"; England/Australia/NZ
// $DefaultDateFormat = "m/d/Y"; US and Canada
$DefaultDateFormat = "m/d/Y";

// Connection information for the database
// $host is the computer ip address or name where the database is located
// assuming that the web server is also the sql server
$host = "localhost";
$DatabaseName = "weberp";

// sql user & password
$dbuser = "web-erp";
$dbpassword = "123";

// CSS theme
$theme = "default";

// Accounts Receivable
// Aging periods used on customer and supplier enquiry screens and aged listings*/
$PastDueDays1 = 30;
$PastDueDays2 = 60;
$DefaultCreditLimit = 1000;

/*The romalpa clause prints out on the invoice in small type - although of limited use can in some businesses help
> recover bad debts */
$RompalpaClause = "Ownership will not pass to the buyer until the goods have been paid for in full.";

/* Types of receipts - only add or remove elements of the array as required*/
$ReceiptTypes = array("Cheques", "Cash", "Visa", "American Express", "Diners Club", "MasterCard", "Direct Credit");

/* Order Items Selection */
/*In large databases it would be possible to return a gigantic page of parts if insufficient criteria were entered. This variable limits the output to the client browser to reduce waiting and clogging network connections */
$Maximum_Number_Of_Parts_To_Show = 100;

/*orders placed after this hour (an integer from 0 to 23) will be dispatched the following day */
$DispatchCutOffTime = 14;

/*The price list to use if no price defined in the customers normal price list */
$DefaultPriceList = "WS";

/*Stock Units array*/
$StockUnits = array("each", "metres", "kgs", "tonnes", "litres", "lbs", "dozen", "pack");

/*Freight calculations */
/*Default Shipper - this must be an existing Shipper_ID in the table Shippers */
$Default_Shipper = 1;

/*Set DoFreightCalc=True if the order entry should insist on calculating freight cost
Set to False if no freight calculation is forced */
$DoFreightCalc = False;

/* Set $FreightChargeAppliesIfLessThan to the amount below which freight is calculated
and charged */
$FreightChargeAppliesIfLessThan = 1000;
$CountryOfOperation = "CAN";

/* Number of periods of stock usage to show in stock usage enquiries */
$NumberOfPeriodsOfStockUsage = 12;

/* Accounts Payable */
/* System check to see if quantity charged on purchase invoices exceeds the quantity received.
If this parameter is checked the proportion by which the purchase invoice is an overcharge
referred to before reporting an error */
$Check_Qty_Charged_vs_Del_Qty = True;

/* System check to see if price charged on purchase invoices exceeds the purchase order price.
If this parameter is checked the proportion by which the purchase invoice is an overcharge
referred to before reporting an error */
$Check_Price_Charged_vs_Order_Price = True;

/* Proportion by which a purchase invoice line is an overcharge for a purchase order item received
is an overcharge. If the overcharge is more than this percentage then an error is reported and
purchase invoice line cannot be entered
The figure entered is interpreted as a percentage ie 20 means 0.2 or 20% not 20 times
*/
$OverChargeProportion = 20;

/* Sherifoz 26.06.03 Proportion by which items can be received over the quantity that is specified in a purchase
invoice
The figure entered is interpreted as a percentage ie 10 means 0.1 or 10% not 10 times
*/
$OverReceiveProportion = 10;

/* Types of payments - only add or remove elements of the array as required*/
$PaytTypes = array("Cheque", "Cash", "Direct Credit");

/*Calendar Month number of last month in the company's financial year */
$YearEnd = "3";

/*Report Page Length in lines */
$PageLength = 48;

/*Directory under the main directory where part photos/ pictures are to be stored
NB no slashes are necessary. Part pictures in this directory must be .jpg format with this extension
Note that this directory must be created by the system administrator*/
$part_pics_dir = "part_pics";

/*Directory under the main web files directory where report files are to be created NB no slashes are necessary
Note that this directory must be created by the system administrator */
$reports_dir = "reports";

/*Show debug messages returned from an error on the page.
Debugging info level also determined by settings in PHP.ini
if $debug=1 show debugging info, dont show if $debug=0 */
$debug = 1;

/*Security Group definitions - Depending on the AccessLevel of the user defined in the user set up
the areas of functionality accessible can be modified.
Each AccessLevel is associated with an array containing the security categories that the user is entitled to access
Each script has a particular security category associated with it.
If the security setting of the page is contained in the security group as determined by the access level then the user will be allowed access.
Each page has a $PageSecurity = x; variable
This value is compared to contents of the array applicable which is based on the access level of the user.
Access authorisation is checked in header.inc this is where _SESSION["AccessLevel"] is the index of the SecurityGroups array. If you wish to add more security groups with then you must add a new SecurityHeading to the SecurityHeadings array
and a new array of Security categories to the Security Groups array
This mechanism allows more fine grained control of access
SecurityGroups is an array of arrays
The index is the order in which the array of allowed pages is defined new ones can be defined at will
or by changing the numbers in each array the security access can be tailored. These numbers need to read
in conjunction with the Page Security index
*/

$SecurityHeadings = array(
"Inquiries/Order Entry",
"Manufac/Stock Admin",
"Purchasing Officer",
"AP Clerk",
"AR Clerk",
"Accountant",
"Customer Log On Only",
"System Administrator"
);

$SecurityGroups = array(
array(1,2),
array(1,2,11),
array(1,2,3,4,5,11),
array(1,2,5),
array(1,2,3,11),
array(1,2,3,4,5,6,7,8,9,10,11),
array(1),
array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
);

/* Hide incomplete features :
Shipment Ref. in Purchase Order
Contract Ref. in Purchase Order
*/
// Removed version 0.2.1
//$hide_incomplete_features = True;

/* Whether to display the demo login and password or not */
$allow_demo_mode = True;

/*The headings showing on the tabs accross the main index used also in WWW_Users for defining what should be visible to the user */
$ModuleList = array("Orders", "Receivables", "Payables", "Purchasing", "Inventory", "Manufacturing", "General Ledger", "Setup");

//$SessionSavePath='/home/groups/w/we/web-erp/sessions/';

// END OF USER CONFIGURABLE VARIABLES
$rootpath = dirname($_SERVER['PHP_SELF']);
?>


and this is the ConnectDB.inc file:


<?php

$db = mysql_connect($host , $dbuser, $dbpassword);
mysql_select_db($DatabaseName,$db);

//DB wrapper functions to change only once for whole application

function DB_query ($SQL,&$Conn){
$result=mysql_query($SQL,$Conn);
return $result;
}

function DB_fetch_row (&$ResultIndex) {

$RowPointer=mysql_fetch_row($ResultIndex);
Return $RowPointer;
}

function DB_fetch_array (&$ResultIndex) {

$RowPointer=mysql_fetch_array($ResultIndex);
Return $RowPointer;
}

function DB_data_seek (&$ResultIndex,$Record) {
mysql_data_seek($ResultIndex,$Record);
}

function DB_free_result (&$ResultIndex){
mysql_free_result($ResultIndex);
}

function DB_num_rows (&$ResultIndex){
return mysql_num_rows($ResultIndex);
}

function DB_error_no (&$Conn){
return mysql_errno($Conn);
}

function DB_error_msg(&$Conn){
return mysql_error($Conn);
}

function DB_Last_Insert_ID(&$Conn){
return mysql_insert_id($Conn);
}

?>
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear spawnisalive,
Salam,

Is your MySQL user which you were tested by you "web-erp" and password is "123" ?

Best Regards.
Farrukh Ahmed
spawnisalive
Lance Naik
Posts: 30
Joined: Tue Sep 16, 2003 8:21 pm
Location: Karachi
Contact:

Post by spawnisalive »

hi,
yes i have tested MySql with user web-erp and password 123 but i think the problum is not with user name and password i think the problum is with php atleast thats what i think :!:
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear
Salam,

Sir, I read Web-Erp Installation Guide and i saw there.....
Innodb tables must be enabled in the MySQL server. These tables allow database transactions which are a critical component of ERP software.

Innodb tables require some parameters to be set up in my.cnf - there are some examples in the MySQL manual under table types - Innodb tables.

If you have an account set up already in MySQL and innodb tables enabled, then all you need to do is to run one of the sql scripts.

Two scripts are provided:

(i). web-erp-demo.sql This has a minimal amount of demonstration data with a bogus company set up so that transactions can be tried to see how the system works.

(ii). web-erp-new.sql This script has only the basic data necessary to start a new company system off. If you wish to set up your company using the web-erp software, then this is the script to use.This creates a web-erp database and populates it with only the very basic data to start off.
did you enable innoDB Tables for user 'web-erp' ? If No then Check Out MySQL Administration Guide and also check the Enable InnoDB Tables and I prefer you again read the Installation Gudie of Web-Erp Step by Step and Make Sure you had done all the steps ;)

Best Regards.
Farrukh Ahmed
fawad
Site Admin
Posts: 918
Joined: Wed Aug 07, 2002 8:00 pm
Location: Addison, IL
Contact:

Post by fawad »

spawnisalive,
Jargon's answer is still valid. The fact that you get the error:

Fatal error: Call to undefined function: mysql_connect()

suggests that even though php is installed, mysql support for php isn't installed. Please install the Redhat package php-mysql and restart httpd (service httpd restart). In phpinfo, you should get a block for mysql.
mahin
Major
Posts: 605
Joined: Wed Aug 07, 2002 8:00 pm
Location: Karachi
Contact:

web-erp help needed.

Post by mahin »

Agree with Jargon and Fawad , perhaps I can show here my ignorance :) I could be wrong but will you please re-check the database name? I think having read this error message before, just re-type the name part, save and see if the error persists.
spawnisalive
Lance Naik
Posts: 30
Joined: Tue Sep 16, 2003 8:21 pm
Location: Karachi
Contact:

Post by spawnisalive »

hi ppl,
first of all in my last post i was trying to sound funny so if u ppl get the impression that i was rude i am sorry for that.
Now as far as i have read the MySql documentation InnoDB is enable by default in MySql version that comes with Mendrake, i have't checked php-mysql package as as soon as i check it i will update u ppl i will also try to retype the db name hope that works

bye
thx
spawnisalive
Lance Naik
Posts: 30
Joined: Tue Sep 16, 2003 8:21 pm
Location: Karachi
Contact:

Post by spawnisalive »

hi ppl,
weberp is working thanks for all ur help, php-mysql package did the trick i need 1 more favour before we close this topic i would like to write a short note about the problum which i faced during installation so that it might be helpfull for other's in their problum so can u ppl plz guide me..........thx

bye
mahin
Major
Posts: 605
Joined: Wed Aug 07, 2002 8:00 pm
Location: Karachi
Contact:

Post by mahin »

Glad to hear both [ WebEPR working for you and your resolution to write note ] :)

Just go ahead and write what ever you feel others should know.
We will check it and if any thing need explanation, will ask you.
Post that to Wiki not here.
Post Reply