Git Product home page Git Product logo

Comments (10)

HansSchouten avatar HansSchouten commented on May 29, 2024 1

Thanks for the suggestion. However, PHPageBuilder should be able to work without Laravel so the request() helper cannot be added there. I will look into it. Any idea why $_SERVER['REQUEST_URI'] is not defined? Are you running some script via command line?

from laravel-pagebuilder.

tsdevelopment avatar tsdevelopment commented on May 29, 2024 1

Also doesn't work with Laravel 8. The installation workflow also throws several errors.

from laravel-pagebuilder.

sanvu88 avatar sanvu88 commented on May 29, 2024

I get an error when running the command to create the theme. I think $_SERVER['SERVER_NAME'], $_SERVER['REQUEST_URI'] global variable is only accessible when running application through a browser. It will through an error when run php-cli.

from laravel-pagebuilder.

HansSchouten avatar HansSchouten commented on May 29, 2024

Ah ok, in that case it makes at least sense why it is happing. I will fix it asap.

from laravel-pagebuilder.

Dontorpedo avatar Dontorpedo commented on May 29, 2024

same error, but it happens when i try to open the pagebuilder, white page and same error

laravel 7
php 7.4
ubuntu 18.04

from laravel-pagebuilder.

leonp5 avatar leonp5 commented on May 29, 2024

I'm not really firm with PHP and Laravel but the first issues i could solve, as it is described here: #41
But then it ended up with this errors (with Laravel 8) on my local machine (Ubuntu 20.04):

composer require hansschouten/laravel-pagebuilder
Using version ^0.13.0 for hansschouten/laravel-pagebuilder
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   ErrorException 

  Undefined index: SERVER_NAME

  at vendor/hansschouten/phpagebuilder/src/Core/helpers.php:247
    243▕         $port = '';
    244▕         if (isset($_SERVER['SERVER_PORT']) && ! in_array($_SERVER['SERVER_PORT'], [80, 443])) {
    245▕             $port = ":" . $_SERVER['SERVER_PORT'];
    246▕         }
  ➜ 247▕         $currentFullUrl = $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . urldecode($_SERVER['REQUEST_URI']);
    248▕         $currentFullUrl = rtrim($currentFullUrl, '/' . DIRECTORY_SEPARATOR);
    249▕         return $currentFullUrl;
    250▕     }
    251▕ }

      +18 vendor frames 
  19  [internal]:0
      Illuminate\Foundation\Application::Illuminate\Foundation\{closure}()

      +5 vendor frames 
  25  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Installation failed, reverting ./composer.json to its original content.

from laravel-pagebuilder.

vdvcoder avatar vdvcoder commented on May 29, 2024

Error: Undefined index: REQUEST_URI and Undefined index: SERVER_NAME in hansschouten\phpagebuilder\src\Core\helpers.php line 247

I changed line 247 to $currentFullUrl = $protocol . "://" . request()->server('SERVER_NAME') . $port . urldecode(request()->server('REQUEST_URI')); and it work

  • Laravel 6
  • PHP 7.3
  • centOS 7

Also worked for me

from laravel-pagebuilder.

vincent-ikonk avatar vincent-ikonk commented on May 29, 2024

Same error : ErrorException Undefined index: SERVER_NAME

`
243| $port = '';
244| if (isset($_SERVER['SERVER_PORT']) && ! in_array($_SERVER['SERVER_PORT'], [80, 443])) {
245| $port = ":" . $_SERVER['SERVER_PORT'];
246| }

247| $currentFullUrl = $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . urldecode($_SERVER['REQUEST_URI']);
248| $currentFullUrl = rtrim($currentFullUrl, '/' . DIRECTORY_SEPARATOR);
249| return $currentFullUrl;
250| }
251| }
`

from laravel-pagebuilder.

dsultanr avatar dsultanr commented on May 29, 2024

fresh install gives me this error

$:/var/www/html/current# composer require hansschouten/laravel-pagebuilder
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2.0 is now available and you should upgrade. See https://getcomposer.org/2
Using version ^0.14.0 for hansschouten/laravel-pagebuilder
./composer.json has been updated
Loading composer repositories with package information
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2.0 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies (including require-dev)

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223

it is a 1.6 GB for a second

next composer update gives another error

> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover

In helpers.php line 247:

  Undefined index: SERVER_NAME


Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

patching helpers.php

$currentFullUrl = $protocol . "://" . (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '') . $port . urldecode(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '');

gives another

Generating autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover

In helpers.php line 432:

  Class name must be a valid object or a string


Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

from laravel-pagebuilder.

HansSchouten avatar HansSchouten commented on May 29, 2024

Hi everyone, this issue has just been fixed in v0.15.0. Please upgrade your environment.

from laravel-pagebuilder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.