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

  • SEARCH
  • Home
  • 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 6963149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:45:07+00:00 2026-05-27T15:45:07+00:00

When migrating a PHP script from PHP 5.2 to PHP 5.3, I’ve stumbled to

  • 0

When migrating a PHP script from PHP 5.2 to PHP 5.3, I’ve stumbled to the following problem:
The general purpose of the script is data mining.
I have a procedure inside that adds data to the MySQL server.
Since it is really repetitive, I’ve rewritten it (a while ago) to use MySQLi, in particular prepared statements, since there are a total of 3 possible queries to perform.
Anyway, now, on the PHP 5.3 server, the script is crashing on the following line:

mysqli_stmt_bind_result($prepCheck, $id1);

Where $prepCheck is created with $prepCheck = mysqli_prepare($con, $checkQuery) or die("Error");. The query runs fine on the MySQL server ($checkQuery, that is) and the PHP code was working, too, on the previous server.

Running the script with strace didn’t reveal anything, since the last thing in it is the system call for echo "Execute";, which is 29936 19:44:18 write(1, "Execute\n", 8) = 8.

The connection object is not FALSE, and even if it was, it should fail with another error, right?

Here comes the weirdest part:
This procedure does not fail when I run the script, limiting the number of pages visited and the script completes successfully. However, when I set a higher limit, it fails, always on the first call to this procedure, and precisely on this line.

If anyone has any suggestions what could be causing this, they would be deeply appreciated.

I can paste code if anyone needs to see a larger picture, but the procedure is very long and boring to death (may be that’s why the script is failing :).

Here is how the script starts: error_reporting(E_ALL); ini_set('display_errors', '1');.
No error is reported besides the ‘magical’ Segmentation fault. I’m not using APC.

Not sure if it’s relevant, but I’m using CLI to run the script, not a web-interface.

PHP version is 5.3.8, MySQL version is 5.1.56. The memory limit is set to 64MB.

EDIT: The procedure failing + some of the other code is uploaded here: http://codepad.org/KkZTxttQ. The whole file is huge and ugly, and I believe irrelevant, so I’m not posting it for now. The line that’s failing is 113.

  • 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-27T15:45:08+00:00Added an answer on May 27, 2026 at 3:45 pm

    An answer to my own question, since I’ve solved the issue, and there are no other answers…

    Credit goes to @jap1968 for pointing to me to the function mysqli_stmt_error (which I assumed I would not need, since I have error_reporting(E_ALL)).

    The problem was that MySQL had a very weird default configuration: particularly

    connect_timeout = 10
    wait_timeout = 30
    

    This caused the MySQL server to close the connection after only 30 seconds (default is more than a half hour, according to MySQL website). This in turn, caused the mysqli_stmt_bind_result function to fail with a Segmentation Fault.

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

Sidebar

Related Questions

I have an existing PHP script that needs to work with data from an
I'm migrating a TSQL stored procedure to PL/SQL and have encountered a problem -
Migrating from PHP to EJB , I have previous experience of PHP , C++
Just migrating from PHP 5.2 to 5.3, lot of hard work! Is the following
I'm having a strange problem with php PDO and mysql. I have the following
I have created a PHP-script to update a web server that is live inside
I have these two file in my project that I am migrating from php.
I have a php data migration script that serializes an array of text. Somehow,
Migrating app from php. and have this in the view: <%=render :partial => jt-test,
I have a problem with nginx when migrating from apache. all uris are rewrited

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.