Jump to content

netcarver

PW-Moderators
  • Posts

    2,174
  • Joined

  • Last visited

  • Days Won

    44

Posts posted by netcarver

  1. Not fact-checked, but chatGPT suggests this as a history of short tags in PHP...

    Quote
    • Prior to PHP 4.0.0, the short tag syntax was enabled by default, and developers could use either <? or <?php to open PHP code blocks.

    • In PHP 4.0.0, the short tag syntax was disabled by default, due to concerns about compatibility with XML and other markup languages that use the <? syntax. However, developers could still enable short tags by setting the "short_open_tag" configuration option to "On" in the php.ini file.

    • In PHP 5.4.0, the short tag syntax was made optional, and developers could enable it by setting the "short_open_tag" configuration option to "On" or by using the new short echo syntax (<?=) instead of the <?php echo statement.

    • In PHP 7.0.0, short tags were officially deprecated, meaning that they were no longer recommended for use in new PHP code. However, they were still supported for backwards compatibility with older code.

    • In PHP 8.0.0, short tags were removed entirely, meaning that they were no longer supported in PHP code. Developers are now encouraged to use the full <?php opening tag or the short echo syntax instead.

    Does this fit with what you are seeing (given the version of PHP you might be running?)

    • Like 1
    1. Is www/site/modules readable and traversable? (Either world readable (r) and traversable (x) or by the user/group you run php as on that server?)
    2. Are there actually module files in the site/module subdirectories? (ie, does /home/cinemed/www/site/modules/ProcessHannaCode/ have a readable file called ProcessHannaCode.module?)
    3. Any errors at the end of www/site/assets/logs/errors.txt or www/site/assets/exceptions.txt ?
       
  2. I don't see why you couldn't monitor 100 urls every 60s as long as the machine you are using turns over the sockets fast enough (and has high enough limits on how many open handles it can have etc.)  Your server might already have high enough resource limits to allow it, but if it doesn't then ask chatGPT about things like decreasing tcp connection recycling times (wait timeout) and about linux max open files to see how to up the limits.

  3. I know it's not native PW - but you can use parallel curl for this kind of thing.

    $urls = [
        'https://www.example.com/',
        'https://www.google.com/',
        'https://www.github.com/'
    ];
    
    $handles = [];
    
    $multi_handle = curl_multi_init();
    
    foreach ($urls as $url) {
        $handle = curl_init();
        curl_setopt($handle, CURLOPT_URL, $url);
        curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
        curl_multi_add_handle($multi_handle, $handle);
        $handles[] = $handle;
    }
    
    $running = null;
    do {
        curl_multi_exec($multi_handle, $running);
    } while ($running);
    
    foreach ($handles as $handle) {
        $result = curl_multi_getcontent($handle);
        echo $result;
        curl_multi_remove_handle($multi_handle, $handle);
        curl_close($handle);
    }
    
    curl_multi_close($multi_handle);

     

    • Like 5
  4. Some things to check first:

    1. Check the value of the upload_max_filesize directive in your PHP configuration file (php.ini). If the value is set to 2.6MB or lower, it could be limiting the upload size. Increase the value to allow larger file uploads. After making changes to `php.ini`, restart your web server for the changes to take effect.

    2. Check the post_max_size directive, it determines the maximum amount of data that can be sent in a POST request. If the uploaded file exceeds this limit, it can result in incomplete uploads or truncation. Make sure this is set to a size greater than the maximum file size you want to allow.

    After that, if it still doesn't work, you could try looking at the web server configuration. In Apache, you may need to adjust the `LimitRequestBody` directive in your server configuration to allow larger file uploads.

    • Like 2
  5. Looks like you might be saving some unvalidated data in the $currentUser there. I'm not familiar enough with Padloper to know if it handles pre-validating posted data like $input->post->email - but if it doesn't you might be leaving yourself open to stored XSS or an email header injection depending on how that field is used later in the code.

    • Like 1
  6. If you don't use phpmyadmin, simply relying on Adminer as part of Tracy Debugger on your sites, you can use the `--omit-containers=dba` flag as well to remove that container from your setup...

    alias ddpw='ddev config --php-version=8.1 --database=mysql:8.0 --webserver-type=apache-fpm --omit-containers=dba --timezone=UTC'

    You can also install adminer in it's own container if you prefer to run that beside your PW container...

    alias ddmore='ddev get ddev/ddev-adminer && ddev restart && ddev describe'

     

    • Like 1
  7. Simplest way to test is to edit your root .htaccess in the PW install directory and comment out the X-Frame-Options line (just start the line with a hash character '#') and save the .htaccess file, then clear cache and reload the page in your browser. If it works, then this is the issue and you'll either need to add an exception to the .htaccess to allow frame loading from www.domain.com or re-add the line and fix this a different way to ensure the source and iframe both load from domain.com (or both load from www.domain.com)

    • Like 1
×
×
  • Create New...