PHILADELPHIA (AP) _ The longest newspaper strike in the city's history ended Tuesday as the last of nine unions approved new contracts, and the Philadelphia Inquirer geared up its presses to put an edition on the street by early Wednesday morning.

Approval by Teamsters drivers and three other unions of the settlement with the morning Inquirer and afternoon Daily News marked an end to the walkout by 4,700 Philadelphia Newspapers Inc. employees that had idled the presses for 46 days.

The company estimated that it lost $1 million per day in revenues during the strike.

''We're ready,'' said Jerry Dranoff of the mailers. ''A lot us are hurting. We owe a lot of bills.''

At the Inquirer and Daily News building downtown, about 100 employees had gathered outside the main entrance waiting for the final union, the mailers, to vote.

At 4:34 p.m., William Gullifer, spokesman for all nine unions, strode to the door of the white and gray building and said, ''The strike is over.''

''I guess I probably have a ton of mail in there,'' said sports writer Mel Greenberg. ''I hear the book editor has 5 million books piled up to the ceiling.''

The key votes Tuesday were cast by the drivers, who had rejected by 12 votes a proposed contract settlement reached at dawn on Friday. After the 175-163 rejection, Teamsters leaders scheduled a new vote for Tuesday, saying the proposal was misunderstood by members and that 220 members did not vote.

Forty-two more drivers participated in Tuesday's balloting, which produced a 248-132 vote contract approval. About 50 Teamsters streetmen and roadmen concurred in the drivers' decision.

After the drivers' vote, the Newspaper Guild, considering the pact for the first time, ratified it by 606-130. Then, the typographers, who had rejected the proposal Friday, reversed themselves by approving the contract 130-26.

Finally, the mailers voted 495-23 to complete the ratification process by all of the striking unions.

''This is splendid,'' said company spokesman William Broom. He said the first editions of the 519,621-circulation Inquirer and 284,253-circulation Daily News would contain less advertising than usual, but would otherwise appear the same as before. The Inquirer's circulation is 1 million on Sundays.

The long-silent newsroom came back to life Tuesday evening, with writers and editors facing their first deadlines since the strike began Sept. 7.

''It looks like election night,'' said reporter William K. Marimow.'' Everybod y's here and everybody's concentrating intently.''

Each of the contracts calls for an average annual increase in wages and benefits of $37.50 per week over four years. The money is allocated differently by individual unions to cover varying pay scales.

Unions won other benefits, too. The Newspaper Guild said it won a third personal day, effective in 1989, and an early retirement at age 62, beginning in November 1987.

Automation and job security were also important issues in the strike. The mailers said they won assurances about staffing levels relating to the company's proposed installation of new equipment to insert special sections into its newspapers.

Five unions quietly ratified their contracts Friday but did not publicize the votes because they did not wish to appear at odds with the Teamsters. Before the strike began, the unions had decided that none would return until all had ratified their pacts.

The strike left the nation's fifth-largest city without a daily newspaper during a normally high sales and news period that included hearings into the the destruction by police of a neighborhood surrounding the home of the radical group MOVE.

''It was terrible, really depressing, especially with the MOVE hearings going on because we did such a good job on MOVE itself,'' said City Editor Fran Dauth.

''I plan to be there when the presses start tonight just because I want to make sure it happens,'' she said, beaming.

Also Tuesday, the Chicago Sun-Times and a union representing about 275 reporters, editors and photographers agreed upon a tentative contract, averting a walkout at the nation's 10th largest daily newspaper.