Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 962689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:32:55+00:00 2026-05-16T01:32:55+00:00

I need to run a PHP CLI script and give it a LOT of

  • 0

I need to run a PHP CLI script and give it a LOT of memory (it’s an automatic documentation generator that needs to cover a large code base). I have a powerful machine and have allocated 5GB to php, both in php.ini and in an inline ini_set('memory_limit','5120M') declaration in the script file.

If I add these lines to top of the script:

phpinfo();
exit();

… it claims that it has a memory limit of 5120M, as I specified.

But the script still errors out, saying

Fatal error: Allowed memory size of 1073741824 bytes exhausted

… which is 1GB, not 5GB as I specified.

Is there any other place that the script might be looking to determine its memory limit? This is running in Fedora Linux.

(Yes, the ultimate solution may be to rewrite the script to be more efficient, but I didn’t write it in the first place, so before I resort to that, I want to just throw resources at it and see if that works.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T01:32:56+00:00Added an answer on May 16, 2026 at 1:32 am

    The heap limit property is a size_t, which is 32 bits on a 32-bit machine. If this is in bytes, this would limit the memory limit to 4 GB. You may try running it on a 64 bit machine, with 64-bit PHP.

    Edit: confirmed, heap->limit is a size_t (unsigned int) and is in bytes. A memory_limit of -1 sets the heap->limit to 4GB, and does not disable it as the documentation implies. Setting it to 5GB makes it wrap around to 1GB.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 498k
  • Answers 498k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You certainly have a challenge on your hands. As far… May 16, 2026 at 12:24 pm
  • Editorial Team
    Editorial Team added an answer Check the specifications for RSS-feeds, e.g. here: http://www.rss-specifications.com/ or http://www.atomenabled.org/developers/syndication/atom-format-spec.php,… May 16, 2026 at 12:24 pm
  • Editorial Team
    Editorial Team added an answer I accomplished this by creating a singular "Java Project". In… May 16, 2026 at 12:24 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm working on an online PHP application that has a need for delayed PHP
I have an ubuntu server that i have some scripts that need to run
I am trying to implement a php script which will run on every call
I have an sh script that contains the line $PHP_COMMAND -r 'echo get_include_path();' I
I really just wanted to know a bit more about the PHP Cli with
I need this cron job to execute my shell just as it does when
I'm trying to find a good way to maintain PHP configuration differences between a
I've installed various PHP packages to be able to use PHP with Apache but
I am wanting to use ffmpeg to convert video to .flv in php. Currently
1- Let's say my computer ip address is 111.11.111.11, and the server that my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.