OPINION
California state prisoner Jeffrey Taylor appeals the district court’s dismissal of his civil rights suit brought pursuant to 42 *846U.S.C. § 1983. Based on Taylor’s failure to pay an initial filing fee of $6.62, which the court had ordered pursuant to the filing fee provisions of the Prison Litigation Reform Act of 1995, Pub.L. No. 104-134, 110 Stat. 1321 (1996) (“PLRA”), 28 U.S.C. § 1915(b), the district court dismissed the action without prejudice for failure to prosecute diligently and for failure to comply with a court order. This timely appeal followed. We have jurisdiction pursuant to 28 U.S.C. § 1291, and we reverse and remand for further proceedings.
I. BACKGROUND
Taylor lodged his § 1983 civil rights complaint on December 31, 1998, after exhausting his administrative remedies with the Los Angeles County Sheriffs Department. He alleged that on August 7, 1997, he was violently beaten by a prison guard at the Los Angeles County jail and was then refused proper medical attention in violation of his civil rights.
On August 17, 1999, Taylor was granted permission to file his civil rights complaint in forma, pauperis (“IFP”) without prepayment of the full filing fee of $150.00. In accordance with 28 U.S.C. § 1915(b)(1), however, Taylor was ordered to pay an initial, partial filing fee (“initial fee”) of $6.62 within 30 days, to be followed by monthly installments, towards the payment of the full filing fee. The order warned Taylor that the failure to remit the initial fee could result in the dismissal of his case.
When Taylor failed timely to pay the initial fee, the court issued an Order to Show Cause (“OSC”) why the action should not be dismissed without prejudice. In a timely response, Taylor explained that he was unable to pay the $6.62 initial fee because he had no funds in his inmate trust account and had no job or alternate source of income. He submitted a copy of his inmate trust account statement for the period from April 1, 1999, to September 21, 1999, which showed that his account balance was down to zero by June 15, 1999, more than two months before he was first ordered to pay the $6.62 initial fee. Although the statement indicated an April starting balance in excess of $6.62, it also showed a. negative closing balance of - $11.62, which included a hold placed on his account on August 26, 1999, for the $6.62 initial fee.
The court responded by giving Taylor an additional 30 days to pay the initial fee. When Taylor failed meet this new deadline, the court issued another OSC on November 4, 1999. In another timely response, Taylor reiterated his inability to pay the initial fee on the grounds that he had no money, no job, and no alternate source of income.
On November 17, 1999, based on Taylor’s failure to pay the $6.62 initial fee, despite the extensions of time that had been granted, the magistrate judge recommended the dismissal of his action without prejudice for failure diligently to prosecute and failure to comply with a court order. Although the parties did not dispute the fact that Taylor lacked the ability to pay the fee at the time he received the initial order and thereafter, the magistrate judge nonetheless refused to discharge the OSC and recommended dismissal because the record showed that he had previously possessed “sufficient funds to pay $6.62.” On that basis, she reasoned that a dismissal was proper because it had been his “responsibility to budget [these funds] to meet this obligation.” The district court approved the magistrate judge’s recommendations, adopted her factual findings and conclusions of law and, on December *84728, 1999, dismissed Taylor’s civil rights action without prejudice.1
II. STANDARD OF REVIEW
We review the district court’s decision to assess a partial fee pursuant to the IFP statute, 28 U.S.C. § 1915, for an abuse of discretion. See Alexander v. Carson Adult High School, 9 F.3d 1448, 1449 (9th Cir.1993).2 The district court’s findings of fact are reviewed under the clearly erroneous standard. See Smallwood v. Cromartie, 532 U.S. 234, 121 S.Ct. 1452, 1458, 149 L.Ed.2d 430 (2001); Richardson v. Sunset Sci. Park Credit Union, 268 F.3d 654, 657 (9th Cir.2001).
The district court’s dismissal pursuant to 28 U.S.C. § 1915, whether construed as a dismissal for lack of prosecution or as a dismissal for failure to obey an order of the court, is reviewed for an abuse of discretion. See James v. Madison St. Jail, 122 F.3d 27, 27 n. 1 (9th Cir.1997). We review a challenge to the constitutionality of a statute de novo. Dittman v. California, 191 F.3d 1020, 1024-25 (9th Cir.1999). The district court’s interpretation of the PLRA is also reviewed de novo. Mayweathers v. Newland, 258 F.3d 930, 934 (9th Cir.2001).
III. DISCUSSION
Under the PLRA, all prisoners who file IFP civil actions must pay the full amount of the filing fee. 28 U.S.C. § 1915(b)(1). For prisoners unable to pay the filing fee at the time of filing, the statute provides for the assessment and, “when funds exist,” the collection of an initial fee equal to 20 percent of the greater of the prisoner’s average monthly account balance or monthly deposits for “the 6-month period immediately preceding the filing of the complaint or notice of appeal.” Id. After payment of the initial fee, the prisoner must make monthly payments equal to 20 percent of the preceding month’s income credited to the account to be forwarded when the prisoner’s account balance exceeds ten dollars. 28 U.S.C. § 1915(b)(2).
The PLRA provision at issue in this appeal is the “safety-valve” provision, which provides that a prisoner cannot “be prohibited from bringing a civil action ... for the reason that the prisoner has no assets and no means by which to pay the initial partial filing fee.” 28 U.S.C. § 1915(b)(4).
A. Constitutionality of the Filing Fee Provisions
Taylor contends that the filing fee provisions of 28 U.S.C. § 1915(b) violate his constitutional right of meaningful access to the courts and right to equal protection. Although this court has already upheld the constitutionality of the PLRA “three strikes rule,” 28 U.S.C. § 1915(g), see Rodriguez v. Cook, 169 F.3d 1176, 1178 (9th Cir.1999), Taylor’s challenge to the constitutionality of the PLRA’s filing fee provi*848sions is an issue of first impression in this Circuit.
Several circuits have already considered constitutional challenges to § 1915(b) and have uniformly concluded that the PLRA fee filing requirements pass constitutional muster. See Tucker v. Branker, 142 F.3d 1294, 1299, 1301 (D.C.Cir.1998) (holding that § 1915(b) does not violate right of access to the courts or right to equal protection); Luden v. DeTella, 141 F.3d 773, 775-76 (7th Cir.1998) (holding that § 1915(b) does not violate the right of access to the courts); Shabazz v. Parsons, 127 F.3d 1246, 1248-49 (10th Cir.1997) (same); Norton v. Dimazana, 122 F.3d 286, 289-91 (5th Cir.1997) (same); Nicholas v. Tucker, 114 F.3d 17, 20-21 (2d Cir.1997) (holding that § 1915(b) does not violate the right of access to the courts, right to equal protection, or rights under the First Amendment); Mitchell v. Farcass, 112 F.3d 1483, 1489-90 (11th Cir.1997) (holding that § 1915(b) does not violate the Equal Protection Clause); Roller v. Gunn, 107 F.3d 227, 230-34 (4th Cir.1997) (holding that § 1915(b) does not violate the right of access to the courts or right to equal protection); Hampton v. Hobbs, 106 F.3d 1281, 1284-1288 (6th Cir.1997) (holding that § 1915(b) does not violate the right of access to the courts or rights under First Amendment, Due Process Clause, Equal Protection Clause, or Double Jeopardy Clause). We agree.
1. Meaningful Access to the Courts
“It is now established beyond doubt that prisoners have a constitutional right of access to the courts.” Bounds v. Smith, 430 U.S. 817, 821, 97 S.Ct. 1491, 52 L.Ed.2d 72 (1977). That access must be “adequate, effective and meaningful.” Id. at 822, 97 S.Ct. 1491; see also Lewis v. Casey, 518 U.S. 343, 354, 116 S.Ct. 2174, 135 L.Ed.2d 606 (1996) (recognizing the Court’s previous extension of the right of access to the courts to “civil rights actions”). This right, however, is not absolute or unconditional in the civil context, except in a very narrow band of cases where the litigant has “a fundamental interest at stake.” Rodriguez, 169 F.3d at 1180 (citing M.L.B. v. S.L.J., 519 U.S. 102, 117 S.Ct. 555, 136 L.Ed.2d 473 (1996)).
The filing fee requirements placed on prisoners under § 1915(b) do not deprive them of adequate, effective, and meaningful access to the courts. See Norton, 122 F.3d at 290-91; Nicholas, 114 F.3d at 20-21; Hampton, 106 F.3d at 1285. Although the PLRA fee provisions require all prisoners proceeding IFP to pay initial fees and monthly fees thereafter, several provisions of the PLRA decrease the burden the fee requirements place on rights of indigent prisoners to meaningful access to the courts. For example, as mentioned above, the initial and monthly-payment calculations are based on the. prisoner’s assets and are limited to 20 percent of that amount. See 28 U.S.C. §§ 1915(b)(l)-(2). In addition, the initial fee can be collected only “when funds exist” and the monthly payments can be deducted only when the prisoner’s account balance exceeds ten dollars. Id. Moreover, the safety-valve provision ensures that a prisoner cannot be barred from bringing a civil action or an appeal when he or she does not have enough money to pay the initial fee. See 28 U.S.C.
§ 1915(b)(4); Norton, 122 F.3d at 290-91 (stating that the § 1915(b)(4) saving provision “sufficiently guarantees that all prisoners will have access to the courts, regardless of their income”); Nicholas, 114 F.3d at 21 (“An overriding theme of the IFP amendments is that in no event shall a prisoner unable to afford the filing fee be prevented from pursuing his claim.”); Hampton, 106 F.3d at 1284 (ex*849plaining that § 1915(b)(4) made explicit the point that a “prisoner without funds will not be denied access to a federal court based on his poverty”).
In addition, the financial burden of the filing fee requirements is further diminished by the fact that a prisoner’s financial needs are not the same as those of a non-prisoner. Because prisoners are in the custody of the state and accordingly have the “essentials of life” provided by the government, see Hampton, 106 F.3d at 1285 (citing Evans v. Croom, 650 F.2d 521, 523 (4th Cir.1981)), an indigent prisoner would not ordinarily be required to make the choice between his lawsuit and the necessities of life in the same manner that a non-prisoner would. See Tucker, 142 F.3d at 1300.
2. Equal Protection
Taylor contends that the filing fee provisions of the PLRA violate an indigent prisoner’s equal protection rights because it requires him, unlike non-incarcerated indigents, to pre-pay court filing fees. Because indigent prisoners are not a suspect class, Rodriguez, 169 F.3d at 1179, and because, as discussed above, the filing fee provisions are structured so as not to burden any “fundamental rights,” we review § 1915(b) under a rational basis standard. See Hampton, 106 F.3d at 1286 (citing United States v. Kras, 409 U.S. 434, 446, 93 S.Ct. 631, 34 L.Ed.2d 626 (1973)). Therefore, we must uphold the filing fee requirements if they are rationally related to a legitimate government interest. See Cleburne v. Cleburne Living Ctr., 473 U.S. 432, 440, 105 S.Ct. 3249, 87 L.Ed.2d 313 (1985).
The PLRA filing fee provisions were enacted to deter the large number of frivolous inmate lawsuits that were “clogging” the federal courts and “draining” limited judicial resources. See Tucker, 142 F.3d at 1296 (citing statement of Sen. Kyl, 141 Cong. Rec. S7526 (daily ed. May 25, 1995)). This goal of deterring meritless prisoner filings in the federal courts is within the “realm of Congress’s legitimate interests.” Hampton, 106 F.3d at 1287; see also Nicholas, 114 F.3d at 20. The § 1915(b) filing fee requirements are rationally related to the achievement of that interest. See Hampton, 106 F.3d at 1287; Nicholas, 114 F.3d at 20. Congress enacted the PLRA with the belief that the “lack of economic disincentives to filing merit-less cases” had contributed to the proliferation of prisoner litigation, Roller, 107 F.3d at 230, and reasoned that “ ‘[t]he modest monetary outlay will force prisoners to think twice about the case arid not just file reflexively,’” see Mitchell, 112 F.3d at 1488 (quoting statement of Sen. Kyl, 141 Cong. Rec. S7526 (daily ed. May 25, 1995)).
In addition, some courts have further noted that prisoners have greater incentives to file frivolous lawsuits. See e.g., Cruz v. Beto, 405 U.S. 319, 327, 92 S.Ct. 1079, 31 L.Ed.2d 263 (1972) (stating that prisoners have unique incentives to file meritless or frivolous lawsuits, e.g., to attempt to obtain a “short sabbatical in the nearest federal courthouse”); Nicholas, 114 F.3d at 20 (stating that the “very nature of incarceration,” including the substantial free time, living expenses paid by the state, and “the essential resources needed to file actions and appeals” provided free of charge, fosters an environment which “allows inmates indiscriminately to file suit”); Roller, 107 F.3d at 234 (stating that prisoners “often have free time on their hands that other litigants do not possess”). These additional grounds further support the existence of a rational basis for the PLRA’s filing fee provisions.
In sum, we conclude that the PLRA filing fee provisions satisfy rational basis *850scrutiny and thus do not violate an indigent prisoner’s constitutional right to equal protection of the laws.
B. Assessment of the Initial Fee
Although the court can collect the initial fee only “when funds exist,” the court is to assess the initial fee based on the prisoner’s account deposits and balances in the six-month period immediately preceding the filing of the complaint. See 28 U.S.C. § 1915(b)(1). The district court’s assessment of a $6.62 initial fee, based on Taylor’s past account balances and application of the formula set forth in § 1915(b)(1), was therefore not an abuse of its discretion.3 See Hatchet v. Nettles, 201 F.3d 651, 652 (5th Cir.2000).
C. The Safety-Valve Provision
Finally, we must determine whether the district court erred in dismissing Taylor’s action under the “safety-valve” provision, § 1915(b)(4).
While, as we have held above, it was proper for the district court to assess the initial fee of $6.62, despite Taylor’s changed financial circumstances, the court can only collect this fee “when funds exist.” See 28 U.S.C. § 1915(b)(1). More importantly, under the safety-valve provision, “[i]n no event shall a prisoner be prohibited from bringing a civil action ... for the reason that the prisoner has no assets and no means by which to pay the initial partial filing fee.” 28 U.S.C. § 1915(b)(4) (emphasis added).
The plain language of § 1915(b)(4) compels a holding that a district court cannot dismiss an IFP prisoner’s case based on his failure to pay the initial fee when his failure to pay is due to the lack of funds available to him when payment is ordered. It is clear that Congress intended that, for prisoners like Taylor, whose prior account balances resulted in the assessment of an initial fee, but who presently do not have the means to pay the initial fee, the safety valve provision should protect them from having their cases dismissed for non-payment.
These protective provisions authorize the district court to collect the initial partial filing fees from prisoners only “when funds exist.” See 28 U.S.C. § 1915(b)(1); Hampton, 106 F.3d at 1284 (stating that the “payment of this fee is made only when funds exist”). Accordingly, when no funds exist when the initial fee order is made, the court is not authorized to dismiss an action as a sanction for the plaintiffs failure to pay the initial fee. See 28 U.S.C. § 1915(b)(4).
It is undisputed that the sole reason Taylor failed to pay the initial fee of $6.62 was because his inmate trust account had a negative balance from the time he was first ordered to pay the initial fee up until the time his case was dismissed. In fact, the initial fee is shown as a “hen,” ie., a hold was placed against Taylor’s inmate trust account on August 26, 1999, for the initial fee. This hold will ensure that Taylor will be required to pay the initial fee as soon as sufficient funds are credited to his account. Thus, permitting Taylor to maintain this action will not undermine the goal of requiring the initial fee to be paid eventually, and therefore to deter the filing of frivolous inmate lawsuits.4 We therefore conclude that the district court abused its discretion when it erroneously interpreted the PLRA safety-valve provision as per*851mitting the dismissal of Taylor’s civil rights case for his failure to pay the initial fee, even though it is uncontested that he lacked the means to do so.
This case also demonstrates that an indigent prisoner’s inability to pay the initial fee can continue for an indefinite period of time. Although extending the deadline for the payment of the initial fee in such a case will prevent the improper dismissal of the prisoner’s suit for lack of payment, such extensions can also result in concomitant lengthy delays in resolving the merits of the action that would be inconsistent with the protection provided by the safety-valve provision. To avoid such a result, when the safety-valve provision applies to the initial fee, the prisoner-plaintiff should be permitted to proceed with his action, rather than be subjected to repeated OSCs for failure to pay the initial fee. See Hatchet, 201 F.3d at 653 (setting forth a procedure under which a prisoner who cannot pay the initial fee can still proceed); Tucker, 142 F.3d at 1296 (noting that under the safety-valve provision, a prisoner who cannot pay the initial fee “may still proceed with his case and pay the whole fee over time”).
IV CONCLUSION
In sum, we hold that the filing fee provision of the PLRA, § 1915(b), does not violate either Taylor’s right of meaningful access to the courts or his right to the equal protection of the laws. We also affirm the district court’s assessment of the $6.62 initial fee.
Because we conclude, however, that a prisoner cannot be prohibited from bringing and prosecuting a civil rights action because of his inability to pay the initial fee, the district court abused its discretion in dismissing Taylor’s action for failure to prosecute and for failure to comply with the court order to pay the initial fee. We accordingly reverse the order of dismissal and remand for further proceedings.
REVERSED and REMANDED.