BELLFLOWER, Calif. (AP) _ The president of a firm that manufactured Mexican-style cheese must serve 30 days in jail for offenses stemming from California's largest food-poisoning epidemic, in which tainted cheese caused at least 40 deaths.

In Los Cerritos Municipal Court, Judge James Pearce also ordered two years' probation and an $18,800 fine for Gary McPherson, 45, president of Jalisco Mexican Products Inc.

McPherson's attorney, Roger Rosen, argued that as a corporate officer in charge of business, his client was not aware of the actual food manufacturing process.

''He didn't know what was going on,'' Pearce said, ''but he had a duty to know what was going on.''

McPherson was ordered to report to jail Aug. 1.

Jalisco - which still exists as a corporation even though its factory in the Los Angeles suburb of Artesia is closed - was ordered to pay a $20,500 fine and placed on probation for three years, which means it could be fined again for any further violations.

McPherson, Jalisco and the company's chief cheese maker, Jose Luis Medina, had been named in March in a 60-count misdemeanor complaint accusing them of violations of California's agricultural, health and safety codes, including food adulteration and operating an unsanitary food establishment.

In subsequent plea bargain agreements, McPherson pleaded no contest to 10 counts, Jalisco to 11 counts and Medina to 12 counts. Medina received a 60-day jail sentence and was fined $9,300 in May.

Jalisco's factory was shut and its cheeses recalled on June 13, 1985, when health authorities revealed they had implicated the company's soft, cheeses in an epidemic of the severe, flu-like bacterial disease listeriosis.

The epidemic hit especially hard at Southern California's Hispanic community, which was a major consumer of the cheese. The company also faces at least 18 legal actions by relatives of those who allegedly died as a result of the epidemic.

While 84 Californians died and another 159 were sickened, the state Department of Health Services definitively linked Jalisco cheese to 40 deaths and 63 non-fatal cases.

Nationwide totals never were compiled, but an estimated 80 percent of the deaths and illnesses occurred in California, Dr. Michael Linnan, an epidemiologist at the national Centers for Disease Control, said Thursday.

Linnan agreed the epidemic killed at least 40 Californians. Of those, 38 were unborn, stillborn or newborn Hispanic babies.

The epidemic was the largest known food poisoning in California history, said Deputy District Attorney Clifford Klein.

In June 1985, prosecutors said they might seek involuntary manslaughter charges in the case, based on preliminary evidence that raw, or unpasteurized, milk was mixed with pasteurized milk to make the cheese. But prosecutors said in March they lacked enough evidence to substantiate felony charges.

The source of the bacteria that contaminated the cheese never was determined. Local, state and federal officials concluded last December that the most likely source was the raw milk that was to be pasteurized before use in the cheese-making process.

Alta-Dena Dairy, which collected raw milk for Jalisco from its own and other dairy herds, strongly disputed that conclusion.