Exhibit 23.1 CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM We consent to the incorporation by reference in the following Registration Statements: 1) Registration Statement (Form S-3 No. 333-115163), of A.P. Pharma, Inc., 2) Registration Statement (Form S-8 No. 333-06841), pertaining to the 1992 Stock Plan of A.P. Pharma, Inc., 3) Registration Statement (Form S-8 No. 333-60585), pertaining to the 1992 Stock Plan of A.P. Pharma, Inc., 4) Registration Statement (Form S-8 No. 333-35151), pertaining to the 1997 Employee Stock Purchase Plan of A.P. Pharma, Inc., 5) Registration Statement (Form S-8 No. 333-90428), pertaining to the 2002 Equity Incentive Plan and Non-Qualified Stock Option Plan of A.P. Pharma, Inc., and 6) Registration Statement (Form S-8 No. 333-118546), pertaining to the 2002 Equity Incentive Plan and 1997 Employee Stock Purchase Plan of A.P. Pharma, Inc., and 7) Registration Statement (Form S-8 No. 333-127574) pertaining to the 2002 Equity Incentive Plan and 1997 Employee Stock Purchase Plan of A.P. Pharma, Inc.; of our report dated February 24, 2006 with respect to the financial statements and schedule of A.P. Pharma, Inc. included in this Annual Report (Form 10-K) for the year ended December 31, 2005. /s/ERNST & YOUNG LLP Palo Alto, California March 27, 2006