Jump to content

iwato

Members
  • Content Count

    1,506
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by iwato


  1. BACKGROUND:  My goal is to emulate on my local server what occurs on my remote server for the purpose of offline development.  On my remote server I have two add-on domains called grammarcaptive.com and nudge.online.  I also have one subdomain called tutor.grammarcaptive.com

    The content folder for tutor.grammarcaptive is located in the same folder as the grammarcaptive.com folder.  All of these domain and subdomain name servers communicate with the same MySQL databases.  I have not yet  set up MySQL, but PHP is working well in a simple localhost environment that points to a root document folder at /Library/Webserver/Documents.  However, all of my content on my local server resides in the same /Users/username/Sites folder.  It is to this folder that I would like Apache to point and, of course, PHP to point.

    I am working in a MacOS 10.15.4 operating environment using Apache 2.4.41.  I envision a file structure as follows:

    /Users/username/Sites/grammarcaptive.com
    /Users/username/Sites/grammarcaptive.com/tutor
    /User/username/Sites/nudge.online

    Once again, it is crucial that I have three virtual domain servers of which each can send HTTP Requests to the other.  Once again, the three servers should be called:

    grammarcaptive.com
    tutor.grammarcaptive.com
    nudge.online

    QUESTION ONE:  Is this a reasonable goal?
    QUESTION TWO:  If this goal is reasonable, how would I go about setting it up?
    QUESTION THREE:  If this goal is unreasonable, what work around would you recommend?

    Please advise.

    Roddy


  2. Well, yeah,  a myriad of solutions with few explanations as to why. A lot of guesswork with no real understanding as to outcome.  If it works takes it, and be happy that it works.  Are there secondary outcomes for which you may be sorry later.  Who knows?

    My hope was that there was someone knowledgeable about Apple MacOS 10.15.4 and Apache 2.4.41.

    Thanks, anyway. You did teach me a little about trouble shooting my Javascript.

    Roddy


  3. Having cleaned up the .htaccess file so that it would be better configured for my own operating system I returned to the Apache error log to see, if there had been any change.  The change suggests that the problem is not unique to the grammarcaptive.com folder; rather it is a problem of all folders that must connect to the internet.  Here is what I found in two steps:  first in the Apache error log and then in Terminal with the Apache path and command provided in the error code.

    Apache Error Log

    [Sun May 03 15:30:07.298098 2020] [mpm_prefork:notice] [pid 1357] AH00163: Apache/2.4.41 (Unix) PHP/7.3.11 mod_perl/2.0.9 Perl/v5.18.4 configured -- resuming normal operations
    [Sun May 03 15:30:07.298156 2020] [core:notice] [pid 1357] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

    Terminal

    % /usr/sbin/httpd -D FOREGROUND
    
    			AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using jupiter.local. Set the 'ServerName' directive globally to suppress this message
    			(48)Address already in use: AH00072: make_sock: could not bind to address [::]:80
    			(48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
    			no listening sockets available, shutting down
    			AH00015: Unable to open logs

    What I did differently from anything I have found on the internet was to change both the User and Group directives from _www to the same values of my /Sites folder.  Only in this way was I able to get both Apache and PHP to access the files and folders of my /Sites folder.

    Any suggestions on how to proceed?

    Roddy

     

     


  4. Here is the relevant code to which I referred above.

    		var refer_type;
    // 		refer_type = <?php echo $refer_type; ?>;
    		refer_type = 0;
    		console.log('refer_type: ' + refer_type);
    		var panelType = <?php echo "'" . $panel_type . "'";?>;
    		var langType = <?php echo "'" . $lang_type . "'";?>;
    		var navtype = Boolean(1);

    The new complaint is panel_type.

    But, now I am confused about the use of the console.log( ) function. The complaint about refer_type not having a value has disappeared, but nothing appears in the Web Console.  Is this because all of the Javascript must work before the console.log( ) result is displayed?

    Roddy


  5. Alright, I have performed what you suggested, and the complaint disappeared and then reappeared in a similarly constructed line just below. The following variable assignment is being rejected. 

    <?php echo "'" . $some_php_variable . "'";?>;

    As you suggest, something appears to be preventing PHP from doing its job.  As PHP works in other folders in the same /Sites folder to which Apache points, the problem must lie within the configuration settings unique to the grammarcaptive.com folder.  I am beginning to understand.

    Besides the .htaccess files can you think of any other sources that might create a conflict?

    Roddy

    ps.  I apologize for not having removed the second appearance of var.  It has been some time since I have coded, and I overlooked the duplication.


  6. OK.  This is what I have done:

    1) As I am not working with cPanel on my local test server, I eliminated all reference to the EasyApache2 on my local server.  This had no effect.

    2) I defined the Javascript variable refer_type before use.   This had no effect.

    3) I tried to discover the value of refer_type but was unable.  Please see the code below.

    		var refer_type;
    		var refer_type = <?php echo $refer_type; ?>;
    		console.log('refer_type: ' + refer_type);

    I have not yet added the server name in the httpd.conf file, as I an expecting to create a number of integrated virtual test servers in the future.  In the meantime I am looking for other problems on my local server that may be created by my dependency on cPanel on my remote server.

    Please advise further.

    Roddy

     


  7. Hi Dsonesuk!

    So, I performed the following, but there was no change.  This was to be expected, however.  The mainpage works fine on the remote server with both versions of PHP.

        $refer_type = 0;
        if (isset($_GET['refer_type']) && filter_var($_GET['refer_type'], FILTER_VALIDATE_INT)) {
            $refer_type = $_GET['refer_type'];
        } else {
            $refer_type = 0;
        }

    Roddy


  8. Hello!

    I hope that you are surviving CoVID-19 in the best of mental and physical health.  My newly acquired hard- and software is helping me in this regard, and for this I am very fortunate.  It was not easily obtained, but it was obtained in time!

    BACKGROUND:  I have just created a new test server -- the first on my current equipment -- and downloaded my remotely hosted Grammar Captive site folder from the internet to become my first locally hosted server. Installed are Apache 2.4.41, PHP 7.3, and MacOS 10.15.4.  I also installed PERL along the way.  The test server appears to be working as it should.  A phpinfo.php file was inserted into the top folder of my web folder, and it displays proudly the information associated with the phpinfo() function.  Just to be sure I also included an .htaccess file with the following code in my /Sites folder -- the location of my site folder.

    <IfModule mime_module>
        <Files grammarcaptive.com/overview.html>
            AddType application/x-httpd-ea-php73 .php .html
        </Files>
    </IfModule>
    
    <IfModule mime_module>
      AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
    </IfModule>

    Although the Javascript in my landing page works fine, the javascript in my sites main page (overview.html) fails completely.  I am confronted with the following two error messages.
     

    SyntaxError: expected expression, got '<'
    ReferenceError: refer_type is not defined

    As you consider these errors, please understand that the downloaded site folder is a mirror image of what works perfectly fine on my remotely located web host server.  The corresponding PHP and Javascript are provided below.

    PHP (overview.html)

        if (isset($_GET['refer_type']) && filter_var($_GET['refer_type'], FILTER_VALIDATE_INT)) {
            $refer_type = $_GET['refer_type'];
        } else {
            $refer_type = 0;
        }

    JAVASCRIPT (overview.html)

     

           var refer_type = <?php echo $refer_type; ?>;


    JAVASCRIPT (overview.js)

        if (!refer_type && !navtype && (viewportWidth > 600) && !returnType) {
            var fileName = '';
            $.colorbox({opacity: '0.70', transition: 'elastic', speed: 700, width: 700, height: 'auto', scrolling: false, html:"<div id='welcome_slide'> <table> <tr> <td width=250 height='auto'> <img src='_images/freed_captive.png' height=200 width=200 /> </td> <td width=450 height='auto'> <h1>Hi!</h1><h2>My name is Roddy.</h2> <p class='welcome'>This is your gateway out of the prison of bad grammar.</p><p>Let me show you to the final gate!</p></td> </tr> </table> </div>",
                onClosed: function() {
                    $("iframe.splash").colorbox({iframe: true, fastiframe: false, fixed: false, opacity: "0.65", open: true, rel: 'sweet', width: 700, height: 450, closeButton: true, href: function(){
                        var href = $(this).attr('src');
                        function extractFileName (href) {
                            var slash = '/';
                            var fullStop = '.';
                            href_str = '';
                            var href_arr = href.split(fullStop);
                            href_arr.pop();
                            if (href_arr.length > 1) {
                                href_str = href_arr.pop();
                                href_arr = href_str.split(slash);
                                if (href_arr.length > 1) {
                                    href_str = href_arr.pop();
                                }
                            } else {
                                href_arr = href_arr[0].split(slash)
                                if (href_arr.length > 1) {
                                    href_str = href_arr.pop();
                                } else {
                                    href_str = href_arr[0];
                                }
                            }                                        
                            return href_str;
                        }
                        fileName = extractFileName(href);
                        _paq.push(['trackEvent', 'Gate One', 'Click', fileName]);                   
                        return href;
                    }
                });
            }});
        }

    COMMENT AND INQUIRY: Although PHP error reporting is included in the mainpage document, no error are reported.

        error_reporting(E_ALL);
        ini_set('log_errors', 1);
        ini_set('html_errors', 1);
        ini_set('error_log', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'error.log');
        ini_set('display_errors', 0);

    The Apache error log yields only the following, and I am with the understanding that it is only an unimportant warning in a local test server.

            [Sat May 02 09:48:31.124803 2020] [mpm_prefork:notice] [pid 7841] AH00169: caught SIGTERM, shutting down
    AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using jupiter.local. Set the 'ServerName' directive globally to suppress this message
    
            [Sat May 02 10:21:07.064389 2020] [mpm_prefork:notice] [pid 157] AH00163: Apache/2.4.41 (Unix) PHP/7.3.11 mod_perl/2.0.9 Perl/v5.18.4 configured -- resuming normal operations
            [Sat May 02 10:21:07.064468 2020] [core:notice] [pid 157] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

    What does appear on the page is unread PHP.  This would suggest that the problem is related to the version of PHP.  This does not appear to be the case, however.  Recently I upgraded my remote server from PHP 7.2 to 7.3 so that it would match the PHP version my new machine.  And, the page functions quite normally on the remote server.

    I am at a loss.

    Please advise.

    Roddy
     

     

     

     


  9. Hi, Dsonesuk!

    It turns out that I am no longer using the page hito.html, anyway.  Rather, everything is handled by the www.hashimori.com/index.html page.  I had forgotten that I reformatted the site two years ago.  To this point can you explain the very unusual sequencing of gallery figure elements as one traverses back and forth across the various <figure> elements?

    Roddy


  10. OK.  I believe that I have corrected the problem by changing the link.

    Please, if I have understood you correctly, you can never point to an internet address located inside an iframe tag and expect it to open.  Is this correct?

    Roddy


  11. BACKGROUND: Please perform the following steps, you will see the problem.  The two domains indicated are different folders in the same public_html file.

    Step 1:  Open to https://www.grammarcaptive.com/overview.html

    Step 2:  Scroll to the bottom and click on the link https://www.hashimori.com

    Now, this latter page will open in a browser, if it is accessed directly, but not when accessed from the page indicated in Step 1.

    Why is this, and what is the solution?

    Roddy


  12. The phpversion() function is not available to me, but the phpinfo() function is.  It yielded PHP Version 7.0.33 when I ran it.  I am beginning to feel the need to dump cPanel.  This is the second major problem that I have had with it, and CENTOS WHM appears to handle everything that cPanel does and more without all of the frustration.  CPanel was useful while I was on a shared server, but I now have my own.

    I will return later with the outcome.

    Roddy


  13. OK.  I have found a real error.  Not only does it appear that I have not been keeping current, (If only you knew how difficult it hsa been.) but also the originator of the software that I am using.  I now have what I believe to be a bug.  Any ideas on how to fix it.

    [05-Jan-2020 23:08:20 UTC] PHP Parse error:  syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) in /home/.../vendor/villfa/invert-color/src/Color.php on line 16

    Here is the relevant link:  https://github.com/villfa/php-invert-color

    In my code the error occurs here:

    $color_pair = select_color_pair(true);
    $ictext_color = $color_pair['text_color'];

  14. Before I try that I would like to bring your attention to a very important point:  your prior instruction was quite good.  It alerted me to the fact that I had failed to remove a var_dump of what was being received by the reset_captcha.php file. Your not gonna like what follows though.  The reset_captcha.php file is once again reporting a 500 error.  I am absolutely amazed, but somehow feel that we are coming closer.  Please do not leave.

    Roddy

     


  15. Yes, the file is now reported as loaded, and WebConsole is now reporting a Javascript error, but I am not sure from where.  Above is the only use of the JSON.parse command in the entire calling file.

    success: function(jsonData) {			
        jsonObj = JSON.parse(jsonData);
        captcha_sa = jsonObj.captcha_ra;
        $('.CaptchaLabel').css('background-color', jsonObj.captcha_rc);
        $('.CaptchaAnswer').val('');
        $('.CaptchaLabel').html(jsonObj.captcha_rq);
        $('.CaptchaError').css('display', 'none');			
    }

    This is the error message:

    SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

    Wow!  And, just when I thought things were looking bleak. :-)

    Roddy


  16. I replaced each of the lines one at a time. With each newly unveiled line I checked the functionality in my browser, and the PHP error log.  At no point was any error code exhibited.  I even reset the line that I had previously commented out. Nothing.

    I am currently researching how to update composer.  The number of composer.json files that I have is absolutely amazing.  They are everywhere and mostly places where I never have been and have no desire to go.

    OK.  I have just updated with php composer.phar 

    Roddy

×
×
  • Create New...