PERIODICALLY Error: zend_mm_heap corrupted - symfony

Description: PERIODICALLY when adding a file through the API, the server crashes with the error in /var/log/httpd/error_log: zend_mm_heap corrupted.
This happens sometimes, then itself begins to work normally. Ie file is normally loaded, then it ceases to be loaded. Although at this time the other can be loaded normally.
I use API /api/providers/sonata.media.provider.file/media
The provider of the file system: sonata.media.filesystem.ftp
Development environment: no matter dev / prod
Composer:
sonata-project/media-bundle: "2.3.x-dev"
knplabs/gaufrette: >=0.1.4
apache+mod_php:
httpd-2.2.15-47.el6.centos.x86_64
httpd-itk-2.2.22-7.el6.x86_64
php55w-5.5.30-2.w6.x86_64
Other:
zend.enable_gc = Off
opcache.fast_shutdown = Off
USE_ZEND_ALLOC = 0
Issue: https://github.com/sonata-project/SonataMediaBundle/issues/866

Same issues with similar Symfony 3 with media bundle setup.
php_flag opcache.enable Off
Disabling opcache in .htaccess / php.ini solved the problem.

Related

Error KnpSnappyBundle / wkhtml - ConnectionRefusedError

I have an incomprehensible problem.
I have used this bundle many times, and I understand the main logic to generate a pdf from a twig view.
But on my two last project i have this kind of error:
Error: Failed to load https://mydomain/bundles/bundle/css/bootstrap.css, with network status code 1 and http status code 0 - Connection refused
Exit with code 1 due to network error: ConnectionRefusedError
I have tried:
HTTP and HTTPS url
chmod 777 on var/cache folder - try acl
disable all parameters of wkhtml
update wkhtml
Disable extends twig view - ihave made a new file with full HTML
Clean controller use assets
filter / absolute_url filter / or web_url variable to prefix assets
On my development environment (Windows), i didn't have any problem.
This problem appeared when I work on production environment, based on Debian 9 with nginx, php 5.6, mariadb 10.0* and letsencrypt certificate.
I can't load any assets for now.
Does anyone have an idea??
Ok i have found a workaround. I use this trick :
create a global variable with this path :
pdf_url: '%kernel.root_dir%/../web'
then i call my assets like this :
<link href="{{ pdf_url}}/bundles/css/bootstrap.css" rel="stylesheet">
Its a not the ebst solution, but its works.

Open files in PHPStorm with Vagrant+Symfony application

I know you can open files from Symfony profiler or exception file links using this in project/app/config.yml :
framework:
ide: "phpstorm://open?file=%%f&line=%%l"
More info: http://developer.happyr.com/open-files-in-phpstorm-from-you-symfony-application
However as I'm using vagrant, the file path of the server doesn't match my host.
I have created a PHP web application server in PHPStorm with the propper path mappings, but still doesn't work.
Any ideas?
Thanks
When running your app in a container or in a virtual machine, you can tell Symfony to map files from the guest to the host by changing their prefix. This map should be specified at the end of the URL template, using & and > as guest-to-host separators:
// /path/to/guest/.../file will be opened
// as /path/to/host/.../file on the host
// as /path/to/host/.../file on the host
'phpstorm://%f:%l&/path/to/guest/>/path/to/host/&/foo/>/bar/&...'
Symfony FrameworkBundle Configuration - IDE
The answer given by Jeffry no longer works unfortunately :(. When In configure that with my paths the profiler throws:
ParameterNotFoundException
You have requested a non-existent parameter "f:".
I have configured the path according to this line in the SF docs: This map should be specified at the end of the URL template, which results in this:
phpstorm://open?url=file://%%f&line=%%l&/path/to/guest/>/path/to/host/
However, it does open PHPStorm, but phpstorm does not open the file, so i'm a bit stuck here now.
This solves the issue with the file not opening in PhpStorm from a Vagrant:
phpstorm://open?file=%%f&line=%%l&/path/to/guest/>/path/to/host/
Source: https://youtrack.jetbrains.com/issue/IDEA-65879

Apache 2.2.16: client denied by server configuration

I have problem with my server configuration. I use Apache 2.216, PHP 5.3.3 and wordpress 3.4.2 with Shopperpress. Time to time I receive error "client denied by server configuration: path/to/file" in apache log file. It is path to _tbs.php file, but it is not problem in rights of file, because this file is called 12 times on page for getting thumbs of photos and there is error only several times. I think that it has no connection to concrete photo, because once this photo is displayed corectly and next time same photo produce error.
Do you have any idea what can be reason?
Thank you for all advices.
Viktor
I think thats a problem by the configuration of MaxClients or MaxRequestsPerChild.
Try to restore the default configuration and try it again. If that not works, reinstall Apache and purge the old configuration.
You have given very little information. It is not clear under what conditions do you work (OS, installed modules, Log entrys,...).
WordPress 3.4.2 is very old and safety-relevant. Please update WordPress and your WP-Plugins.
Go to you VHOST-file and replace:
Deny from all
Allow from 127.0.0.0/255.0.0.0
with:
Require all granted
This cause for old Config-Files and newer Apache-Version. Since Apache 2.4.3 a new security feature is added.

Symfony 2 pdo exception

I'm using Symfony 2 and have this row in my parameters.ini:
database_driver = pdo_pgsql
When I was creating database structure with Doctrine everything was good. But if I want to add some doctrine object to my darabase (insert row), I catch an exception:
What I have to do with this?
Are you sure you're using pdo_pgsql? Are you running on localhost? It might be very certain that you are using pdo_mysql driver instead.
However you have to check the following:
php.ini
extension=pdo.so
extension=pdo_mysql.so
or in your case
extension=pdo.so
extension=pdo_pgsql.so
You can check the phpinfo(); to find out the configured database driver.
In your symfony project you have to check the parameters.ini file in config folder. E.g.
[parameters]
database_driver="pdo_mysql"
database_host="localhost"
Besides try to avoid this error
'stty' is not recognized as an internal or external command,
operable program or batch file.
https://github.com/symfony/symfony/issues/4974
First of all, verify your php.ini file: the extensions php_pdo_pgsql and php_pdo must be enabled. Make sure you apply this changes on php.ini file that your symfony project is using, check this on localhost/path_to_your_project/web/config.php. You know if this extensions are enabled executing the function phpinfo().
This command is also helpfull: php -m. It lists on console all the php modules that are loaded.
Tip: check out you Apache error log, there could be something wrong with the load of your extensions. This file is located according to your server configuration.

Flex, zend production error

I've got my flex, php & zend project working fine on localhost but when I try to move it to production I get the following error:
Class "testService" does not exist: Plugin by name 'testService' was not found in the registry; used
paths:
: /home/myNewFolder/services/
#0 /home/ZendFramework/library/Zend/Amf/Server.php(550): Zend_Amf_Server->_dispatch('paged', Array,
'testService')
#1 /home/ZendFramework/library/Zend/Amf/Server.php(626): Zend_Amf_Server-
>_handle(Object(Zend_Amf_Request_Http))
#2 /home/myNewFolder/gateway.php(69): Zend_Amf_Server->handle()
#3 {main}
I've got my amf_config file as follows:
[zend]
webroot =/home/myNewFolder
zend_path =/home/ZendFramework/library
[zendamf]
amf.production = false
amf.directories[]=services
my .swf & services folder are located in "myNewFolder", which is located under the root of my directory.
I am using Zend version 1.9.4, Flex SDK 4.1. My localhost is windows & production host is Linux
two potential problems, the home on the server is not the path you think. Print home to screen to see what is there. Second, always, always use small letters. Too many problems arise when you write myApp, MyApp or Myapp. just write myapp, and do not worry again
Edit: wait a second, your services path is wrong. I assume it is under New Folder. Your amf directories should change to amf.directories[]=./services
Remember that Unix is case sensitive, and Windows doesn't so check the case, your file should be named testService.php, or TestService.php.

Resources