Recreating a CakePHP 1.2 project in order to upgrade












1















I've got a CakePHP 1.2-based web site (I know.. too ancient) that I need to upgrade only to whatever is the oldest Cake to support PHP 7.1 (I think roughly Cake 2.8, from what I've seen so far), because my host is upgrading PHP to 7.1 across the board. This site only needs to live maybe 1 more year before we totally replace it, but we don't have time to do that before the host upgrades PHP at end of year.



I am trying to get the web site as-is running in a vagrant VM, so I can go through the upgrade steps there, carefully, and understand exactly what I need to do. My problem now is that I can't get the site to display. More concretely, when I try to load the site with nginx in vagrant, I get nothing but a blank screen with a few PHP warnings (strict standards to the effect of Non-static method Configure::read() should not be called statically), but nothing obviously broken. There's basically nothing in the PHP log, and nothing in the Nginx log. Again, this is the site as currently running (successfully) in production, which means my vagrant PHP is 5.6.38 (the actual production PHP is 5.6.25). Running with php-fpm.



Cake's own logs are only reporting the following, which arises inside a controller method function disableCache(), which is trying to insert headers to prevent the browser from caching the request:



2018-10-22 15:18:57 Warning: Warning (2): Cannot modify header information - headers already sent by (output started at /usr/share/nginx/html/www.mydomain.com/cake/libs/object.php:63) in [CORE/cake/libs/controller/controller.php, line 844]


I have inserted an early return in that method just to stop these warnings.



In PHP, I've got these settings:



error_reporting(E_ALL^E_DEPRECATED);
ini_set('display_errors', 1);
ini_set('error_log', '/var/log/php_errors.log');


In Cake 1.2's app/config/core.php, I've got:



Configure::write('debug', 3);


Database is local MySQL in vagrant, with settings in app/config/database.yml.



Can someone suggest where I should go next in debugging this?










share|improve this question

























  • Try executing the code with php -l from the command line. A white screen usually means a 500 server error. Might be from a simple syntax error somewhere in your code that's preventing the interpreter from getting to your additional logging configuration.

    – Erik Giberti
    Oct 23 '18 at 0:29











  • Thanks... php -l on the main index.php for the site gives No syntax errors detected in index.php.

    – Kotodharma
    Oct 23 '18 at 0:57






  • 2





    You say nothing in the PHP or Nginx log; what about the Cake logs? Maybe include those "nothing obviously broken" warnings in your question? Perhaps something is subtly broken. :-)

    – Greg Schmidt
    Oct 23 '18 at 1:15






  • 1





    From personal experience, all of the "non-static method" warnings can be made to go away by editing the Cake core files in question and making those specific functions static. (Normally, editing core files is a no-no, because you lose your edits when you update, but that's obviously not an issue here.) By doing that, you may eliminate all of the early output that's causing the "Cannot modify header information" warning, and once that's gone, maybe more useful information will start to reveal itself.

    – Greg Schmidt
    Oct 23 '18 at 3:53






  • 2





    By the way, have you given thought to using a different host for this (once you get it working again with PHP 5.6) for the next year, instead of upgrading your app to Cake 2.8? Depending on the size of it, it may well be more work than it's worth to do such an upgrade. Especially if it's going to be fully obsoleted soonish. Of course, details of your situation may render this option infeasible.

    – Greg Schmidt
    Oct 23 '18 at 3:58
















1















I've got a CakePHP 1.2-based web site (I know.. too ancient) that I need to upgrade only to whatever is the oldest Cake to support PHP 7.1 (I think roughly Cake 2.8, from what I've seen so far), because my host is upgrading PHP to 7.1 across the board. This site only needs to live maybe 1 more year before we totally replace it, but we don't have time to do that before the host upgrades PHP at end of year.



I am trying to get the web site as-is running in a vagrant VM, so I can go through the upgrade steps there, carefully, and understand exactly what I need to do. My problem now is that I can't get the site to display. More concretely, when I try to load the site with nginx in vagrant, I get nothing but a blank screen with a few PHP warnings (strict standards to the effect of Non-static method Configure::read() should not be called statically), but nothing obviously broken. There's basically nothing in the PHP log, and nothing in the Nginx log. Again, this is the site as currently running (successfully) in production, which means my vagrant PHP is 5.6.38 (the actual production PHP is 5.6.25). Running with php-fpm.



Cake's own logs are only reporting the following, which arises inside a controller method function disableCache(), which is trying to insert headers to prevent the browser from caching the request:



2018-10-22 15:18:57 Warning: Warning (2): Cannot modify header information - headers already sent by (output started at /usr/share/nginx/html/www.mydomain.com/cake/libs/object.php:63) in [CORE/cake/libs/controller/controller.php, line 844]


I have inserted an early return in that method just to stop these warnings.



In PHP, I've got these settings:



error_reporting(E_ALL^E_DEPRECATED);
ini_set('display_errors', 1);
ini_set('error_log', '/var/log/php_errors.log');


In Cake 1.2's app/config/core.php, I've got:



Configure::write('debug', 3);


Database is local MySQL in vagrant, with settings in app/config/database.yml.



Can someone suggest where I should go next in debugging this?










share|improve this question

























  • Try executing the code with php -l from the command line. A white screen usually means a 500 server error. Might be from a simple syntax error somewhere in your code that's preventing the interpreter from getting to your additional logging configuration.

    – Erik Giberti
    Oct 23 '18 at 0:29











  • Thanks... php -l on the main index.php for the site gives No syntax errors detected in index.php.

    – Kotodharma
    Oct 23 '18 at 0:57






  • 2





    You say nothing in the PHP or Nginx log; what about the Cake logs? Maybe include those "nothing obviously broken" warnings in your question? Perhaps something is subtly broken. :-)

    – Greg Schmidt
    Oct 23 '18 at 1:15






  • 1





    From personal experience, all of the "non-static method" warnings can be made to go away by editing the Cake core files in question and making those specific functions static. (Normally, editing core files is a no-no, because you lose your edits when you update, but that's obviously not an issue here.) By doing that, you may eliminate all of the early output that's causing the "Cannot modify header information" warning, and once that's gone, maybe more useful information will start to reveal itself.

    – Greg Schmidt
    Oct 23 '18 at 3:53






  • 2





    By the way, have you given thought to using a different host for this (once you get it working again with PHP 5.6) for the next year, instead of upgrading your app to Cake 2.8? Depending on the size of it, it may well be more work than it's worth to do such an upgrade. Especially if it's going to be fully obsoleted soonish. Of course, details of your situation may render this option infeasible.

    – Greg Schmidt
    Oct 23 '18 at 3:58














1












1








1


1






I've got a CakePHP 1.2-based web site (I know.. too ancient) that I need to upgrade only to whatever is the oldest Cake to support PHP 7.1 (I think roughly Cake 2.8, from what I've seen so far), because my host is upgrading PHP to 7.1 across the board. This site only needs to live maybe 1 more year before we totally replace it, but we don't have time to do that before the host upgrades PHP at end of year.



I am trying to get the web site as-is running in a vagrant VM, so I can go through the upgrade steps there, carefully, and understand exactly what I need to do. My problem now is that I can't get the site to display. More concretely, when I try to load the site with nginx in vagrant, I get nothing but a blank screen with a few PHP warnings (strict standards to the effect of Non-static method Configure::read() should not be called statically), but nothing obviously broken. There's basically nothing in the PHP log, and nothing in the Nginx log. Again, this is the site as currently running (successfully) in production, which means my vagrant PHP is 5.6.38 (the actual production PHP is 5.6.25). Running with php-fpm.



Cake's own logs are only reporting the following, which arises inside a controller method function disableCache(), which is trying to insert headers to prevent the browser from caching the request:



2018-10-22 15:18:57 Warning: Warning (2): Cannot modify header information - headers already sent by (output started at /usr/share/nginx/html/www.mydomain.com/cake/libs/object.php:63) in [CORE/cake/libs/controller/controller.php, line 844]


I have inserted an early return in that method just to stop these warnings.



In PHP, I've got these settings:



error_reporting(E_ALL^E_DEPRECATED);
ini_set('display_errors', 1);
ini_set('error_log', '/var/log/php_errors.log');


In Cake 1.2's app/config/core.php, I've got:



Configure::write('debug', 3);


Database is local MySQL in vagrant, with settings in app/config/database.yml.



Can someone suggest where I should go next in debugging this?










share|improve this question
















I've got a CakePHP 1.2-based web site (I know.. too ancient) that I need to upgrade only to whatever is the oldest Cake to support PHP 7.1 (I think roughly Cake 2.8, from what I've seen so far), because my host is upgrading PHP to 7.1 across the board. This site only needs to live maybe 1 more year before we totally replace it, but we don't have time to do that before the host upgrades PHP at end of year.



I am trying to get the web site as-is running in a vagrant VM, so I can go through the upgrade steps there, carefully, and understand exactly what I need to do. My problem now is that I can't get the site to display. More concretely, when I try to load the site with nginx in vagrant, I get nothing but a blank screen with a few PHP warnings (strict standards to the effect of Non-static method Configure::read() should not be called statically), but nothing obviously broken. There's basically nothing in the PHP log, and nothing in the Nginx log. Again, this is the site as currently running (successfully) in production, which means my vagrant PHP is 5.6.38 (the actual production PHP is 5.6.25). Running with php-fpm.



Cake's own logs are only reporting the following, which arises inside a controller method function disableCache(), which is trying to insert headers to prevent the browser from caching the request:



2018-10-22 15:18:57 Warning: Warning (2): Cannot modify header information - headers already sent by (output started at /usr/share/nginx/html/www.mydomain.com/cake/libs/object.php:63) in [CORE/cake/libs/controller/controller.php, line 844]


I have inserted an early return in that method just to stop these warnings.



In PHP, I've got these settings:



error_reporting(E_ALL^E_DEPRECATED);
ini_set('display_errors', 1);
ini_set('error_log', '/var/log/php_errors.log');


In Cake 1.2's app/config/core.php, I've got:



Configure::write('debug', 3);


Database is local MySQL in vagrant, with settings in app/config/database.yml.



Can someone suggest where I should go next in debugging this?







php nginx cakephp vagrant cakephp-1.3






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 23 '18 at 1:41







Kotodharma

















asked Oct 22 '18 at 23:14









KotodharmaKotodharma

64




64













  • Try executing the code with php -l from the command line. A white screen usually means a 500 server error. Might be from a simple syntax error somewhere in your code that's preventing the interpreter from getting to your additional logging configuration.

    – Erik Giberti
    Oct 23 '18 at 0:29











  • Thanks... php -l on the main index.php for the site gives No syntax errors detected in index.php.

    – Kotodharma
    Oct 23 '18 at 0:57






  • 2





    You say nothing in the PHP or Nginx log; what about the Cake logs? Maybe include those "nothing obviously broken" warnings in your question? Perhaps something is subtly broken. :-)

    – Greg Schmidt
    Oct 23 '18 at 1:15






  • 1





    From personal experience, all of the "non-static method" warnings can be made to go away by editing the Cake core files in question and making those specific functions static. (Normally, editing core files is a no-no, because you lose your edits when you update, but that's obviously not an issue here.) By doing that, you may eliminate all of the early output that's causing the "Cannot modify header information" warning, and once that's gone, maybe more useful information will start to reveal itself.

    – Greg Schmidt
    Oct 23 '18 at 3:53






  • 2





    By the way, have you given thought to using a different host for this (once you get it working again with PHP 5.6) for the next year, instead of upgrading your app to Cake 2.8? Depending on the size of it, it may well be more work than it's worth to do such an upgrade. Especially if it's going to be fully obsoleted soonish. Of course, details of your situation may render this option infeasible.

    – Greg Schmidt
    Oct 23 '18 at 3:58



















  • Try executing the code with php -l from the command line. A white screen usually means a 500 server error. Might be from a simple syntax error somewhere in your code that's preventing the interpreter from getting to your additional logging configuration.

    – Erik Giberti
    Oct 23 '18 at 0:29











  • Thanks... php -l on the main index.php for the site gives No syntax errors detected in index.php.

    – Kotodharma
    Oct 23 '18 at 0:57






  • 2





    You say nothing in the PHP or Nginx log; what about the Cake logs? Maybe include those "nothing obviously broken" warnings in your question? Perhaps something is subtly broken. :-)

    – Greg Schmidt
    Oct 23 '18 at 1:15






  • 1





    From personal experience, all of the "non-static method" warnings can be made to go away by editing the Cake core files in question and making those specific functions static. (Normally, editing core files is a no-no, because you lose your edits when you update, but that's obviously not an issue here.) By doing that, you may eliminate all of the early output that's causing the "Cannot modify header information" warning, and once that's gone, maybe more useful information will start to reveal itself.

    – Greg Schmidt
    Oct 23 '18 at 3:53






  • 2





    By the way, have you given thought to using a different host for this (once you get it working again with PHP 5.6) for the next year, instead of upgrading your app to Cake 2.8? Depending on the size of it, it may well be more work than it's worth to do such an upgrade. Especially if it's going to be fully obsoleted soonish. Of course, details of your situation may render this option infeasible.

    – Greg Schmidt
    Oct 23 '18 at 3:58

















Try executing the code with php -l from the command line. A white screen usually means a 500 server error. Might be from a simple syntax error somewhere in your code that's preventing the interpreter from getting to your additional logging configuration.

– Erik Giberti
Oct 23 '18 at 0:29





Try executing the code with php -l from the command line. A white screen usually means a 500 server error. Might be from a simple syntax error somewhere in your code that's preventing the interpreter from getting to your additional logging configuration.

– Erik Giberti
Oct 23 '18 at 0:29













Thanks... php -l on the main index.php for the site gives No syntax errors detected in index.php.

– Kotodharma
Oct 23 '18 at 0:57





Thanks... php -l on the main index.php for the site gives No syntax errors detected in index.php.

– Kotodharma
Oct 23 '18 at 0:57




2




2





You say nothing in the PHP or Nginx log; what about the Cake logs? Maybe include those "nothing obviously broken" warnings in your question? Perhaps something is subtly broken. :-)

– Greg Schmidt
Oct 23 '18 at 1:15





You say nothing in the PHP or Nginx log; what about the Cake logs? Maybe include those "nothing obviously broken" warnings in your question? Perhaps something is subtly broken. :-)

– Greg Schmidt
Oct 23 '18 at 1:15




1




1





From personal experience, all of the "non-static method" warnings can be made to go away by editing the Cake core files in question and making those specific functions static. (Normally, editing core files is a no-no, because you lose your edits when you update, but that's obviously not an issue here.) By doing that, you may eliminate all of the early output that's causing the "Cannot modify header information" warning, and once that's gone, maybe more useful information will start to reveal itself.

– Greg Schmidt
Oct 23 '18 at 3:53





From personal experience, all of the "non-static method" warnings can be made to go away by editing the Cake core files in question and making those specific functions static. (Normally, editing core files is a no-no, because you lose your edits when you update, but that's obviously not an issue here.) By doing that, you may eliminate all of the early output that's causing the "Cannot modify header information" warning, and once that's gone, maybe more useful information will start to reveal itself.

– Greg Schmidt
Oct 23 '18 at 3:53




2




2





By the way, have you given thought to using a different host for this (once you get it working again with PHP 5.6) for the next year, instead of upgrading your app to Cake 2.8? Depending on the size of it, it may well be more work than it's worth to do such an upgrade. Especially if it's going to be fully obsoleted soonish. Of course, details of your situation may render this option infeasible.

– Greg Schmidt
Oct 23 '18 at 3:58





By the way, have you given thought to using a different host for this (once you get it working again with PHP 5.6) for the next year, instead of upgrading your app to Cake 2.8? Depending on the size of it, it may well be more work than it's worth to do such an upgrade. Especially if it's going to be fully obsoleted soonish. Of course, details of your situation may render this option infeasible.

– Greg Schmidt
Oct 23 '18 at 3:58












2 Answers
2






active

oldest

votes


















0














From my own experience, PHP 7.1 and CakePHP 1.2 can work together. You simply need to upgrade your source code to make it compatible with PHP 7.1 but you can continue to have your system in CakePHP 1.2 without having to upgrade CakePHP. Of course, if you can use a newer or the latest version of CakePHP that would be perfect but think of it as a separate project and not something you must do now only because your host is upgrading PHP to 7.1 across the board.






share|improve this answer































    0














    If you can get your Cake project upgraded to 1.3.21 (the last 1.x release), you may be able to use this: https://github.com/littleant/cakephp-1.3.21 instead of upgrading to Cake 2.x. Might buy you a little time!






    share|improve this answer

























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52938920%2frecreating-a-cakephp-1-2-project-in-order-to-upgrade%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      From my own experience, PHP 7.1 and CakePHP 1.2 can work together. You simply need to upgrade your source code to make it compatible with PHP 7.1 but you can continue to have your system in CakePHP 1.2 without having to upgrade CakePHP. Of course, if you can use a newer or the latest version of CakePHP that would be perfect but think of it as a separate project and not something you must do now only because your host is upgrading PHP to 7.1 across the board.






      share|improve this answer




























        0














        From my own experience, PHP 7.1 and CakePHP 1.2 can work together. You simply need to upgrade your source code to make it compatible with PHP 7.1 but you can continue to have your system in CakePHP 1.2 without having to upgrade CakePHP. Of course, if you can use a newer or the latest version of CakePHP that would be perfect but think of it as a separate project and not something you must do now only because your host is upgrading PHP to 7.1 across the board.






        share|improve this answer


























          0












          0








          0







          From my own experience, PHP 7.1 and CakePHP 1.2 can work together. You simply need to upgrade your source code to make it compatible with PHP 7.1 but you can continue to have your system in CakePHP 1.2 without having to upgrade CakePHP. Of course, if you can use a newer or the latest version of CakePHP that would be perfect but think of it as a separate project and not something you must do now only because your host is upgrading PHP to 7.1 across the board.






          share|improve this answer













          From my own experience, PHP 7.1 and CakePHP 1.2 can work together. You simply need to upgrade your source code to make it compatible with PHP 7.1 but you can continue to have your system in CakePHP 1.2 without having to upgrade CakePHP. Of course, if you can use a newer or the latest version of CakePHP that would be perfect but think of it as a separate project and not something you must do now only because your host is upgrading PHP to 7.1 across the board.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 7 '18 at 20:14









          Jaime MontoyaJaime Montoya

          1,13921732




          1,13921732

























              0














              If you can get your Cake project upgraded to 1.3.21 (the last 1.x release), you may be able to use this: https://github.com/littleant/cakephp-1.3.21 instead of upgrading to Cake 2.x. Might buy you a little time!






              share|improve this answer






























                0














                If you can get your Cake project upgraded to 1.3.21 (the last 1.x release), you may be able to use this: https://github.com/littleant/cakephp-1.3.21 instead of upgrading to Cake 2.x. Might buy you a little time!






                share|improve this answer




























                  0












                  0








                  0







                  If you can get your Cake project upgraded to 1.3.21 (the last 1.x release), you may be able to use this: https://github.com/littleant/cakephp-1.3.21 instead of upgrading to Cake 2.x. Might buy you a little time!






                  share|improve this answer















                  If you can get your Cake project upgraded to 1.3.21 (the last 1.x release), you may be able to use this: https://github.com/littleant/cakephp-1.3.21 instead of upgrading to Cake 2.x. Might buy you a little time!







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 27 '18 at 17:32

























                  answered Nov 27 '18 at 17:01









                  ErebusErebus

                  1,07021227




                  1,07021227






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52938920%2frecreating-a-cakephp-1-2-project-in-order-to-upgrade%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

                      Calculate evaluation metrics using cross_val_predict sklearn

                      Insert data from modal to MySQL (multiple modal on website)