Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Process] Workaround buggy PHP warning#16182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
cbj4074 wants to merge3 commits intosymfony:2.8fromcbj4074:patch-1
Closed

[Process] Workaround buggy PHP warning#16182

cbj4074 wants to merge3 commits intosymfony:2.8fromcbj4074:patch-1

Conversation

@cbj4074
Copy link
Contributor

QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

This temporary workaround is intended to address an uncaught exception that may occur, untilhttps://bugs.php.net/bug.php?id=69240 is fixed.

Obviously the@ operator is another option, but I'm erring towards the notion that the Symfony authors/maintainers may wish to implement more elegant exception-handling logic than simply using@.

This temporary workaround is intended to address an uncaught exception that may occur, untilhttps://bugs.php.net/bug.php?id=69240 is fixed.Obviously the `@` operator is another option, but I'm erring towards the notion that the Symfony authors/maintainers may wish to implement more elegant exception-handling logic than simply using `@`.
@stof
Copy link
Member

stof commentedOct 9, 2015

catching ErrorException is the wrong implementation. Warnings are not turned into exceptions in production

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

who triggers the exception?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

is_dir, see the comment above.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

is_dir triggers warnings, not exceptions. A custom error handler must be registered for an exception to be thrown.
The implementation with an@ is required (same as@stof comments)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@nicolas-grekas I replaced the try/catch with an@.

The relevant stack frame containsHandleExceptions->handleError('2', 'is_dir(): open_basedir restriction in effect. File(/srv/www/example.com/web) is not within the allowed path(s) ... whereHandleExceptions is an instance ofIlluminate\Foundation\Bootstrap\HandleExceptions.

@cbj4074
Copy link
ContributorAuthor

@stof Okay; my apologies. I am not at all familiar with the Symfony code-base, nor the methodologies that it employs. As much as I would love to read-up and offer a more appropriate solution, I simply lack the time. Perhaps you or another contributor is able to discern the problem and fix it correctly.

@nicolas-grekas From what I'm able to determine, PHP'sis_dir() method triggers the exception. The behavior results from a confirmed bug in PHP (see PR description for link to issue).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM, can you just add a comment like this one please?

// Silencing against https://bugs.php.net/69240

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Done. Please let me know if you had something different in mind. Thanks!

@nicolas-grekas
Copy link
Member

👍 thanks

@nicolas-grekasnicolas-grekas changed the titleAdd temporary workaround for known PHP bug[Process] Workaround buggy PHP warningOct 9, 2015
@xabbuh
Copy link
Member

👍

@cbj4074
Copy link
ContributorAuthor

Thanks for the quick turnaround! 🍻

@Tobion
Copy link
Contributor

Thank you@cbj4074.

Tobion added a commit that referenced this pull requestOct 9, 2015
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes#16182).Discussion----------[Process] Workaround buggy PHP warning| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -This temporary workaround is intended to address an uncaught exception that may occur, untilhttps://bugs.php.net/bug.php?id=69240 is fixed.Obviously the `@` operator is another option, but I'm erring towards the notion that the Symfony authors/maintainers may wish to implement more elegant exception-handling logic than simply using `@`.Commits-------b1bd093 [Process] Workaround buggy PHP warning
@TobionTobion closed thisOct 9, 2015
This was referencedOct 27, 2015
@cbj4074cbj4074 deleted the patch-1 branchNovember 10, 2015 16:51
nicolas-grekas added a commit that referenced this pull requestMay 15, 2018
… (cbj4074)This PR was merged into the 2.7 branch.Discussion----------[Process] Suppress warnings when open_basedir is non-empty| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |If PHP is configured *with a non-empty open_basedir* value that does not permit access to the target location, these calls to is_executable() throw warnings.While Symfony may not raise exceptions for warnings in production environments, other frameworks (such as Laravel) do, in which case any of these checks causes a show-stopping 500 error.We fixed a similar issue in the ExecutableFinder class via#16182 .This has always been an issue, butsymfony/process@709e15e made it more likely that a warning is triggered.Commits-------34f136e Suppress warnings when open_basedir is non-empty
symfony-splitter pushed a commit to symfony/process that referenced this pull requestMay 15, 2018
If PHP is configured *with a non-empty open_basedir* value that does not permit access to the target location, these calls to is_executable() throw warnings.While Symfony may not raise exceptions for warnings in production environments, other frameworks (such as Laravel) do, in which case any of these checks causes a show-stopping 500 error.We fixed a similar issue in the ExecutableFinder class viasymfony/symfony#16182 .This has always been an issue, but709e15e made it more likely that a warning is triggered.
symfony-splitter pushed a commit to symfony/process that referenced this pull requestMay 15, 2018
… (cbj4074)This PR was merged into the 2.7 branch.Discussion----------[Process] Suppress warnings when open_basedir is non-empty| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |If PHP is configured *with a non-empty open_basedir* value that does not permit access to the target location, these calls to is_executable() throw warnings.While Symfony may not raise exceptions for warnings in production environments, other frameworks (such as Laravel) do, in which case any of these checks causes a show-stopping 500 error.We fixed a similar issue in the ExecutableFinder class viasymfony/symfony#16182 .This has always been an issue, but709e15e made it more likely that a warning is triggered.Commits-------34f136e01b Suppress warnings when open_basedir is non-empty
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@cbj4074@stof@nicolas-grekas@xabbuh@Tobion@dosten@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp