回答 1 已采纳
I run project on symfony (2.5.7) with sonata (2.3). If I run it under Ubuntu with apache2 and php there is no problem with correct working of forms and all the other parts of symfony. But I want to have the code on Windows with, ability to run bash scripts that doing the job to deploy project correctly. That's why I set up Cygwin with cygserver and apache and php. I managed to run my project on apache for cygwin but every time I open the edit form I get error like that:
The name "s547b06c97e7c79.42607283" contains illegal characters. Names should start with a letter, digit or underscore and only contain letters, digits, numbers, underscores ("_"), hyphens ("-") and colons (":").
500 Internal Server Error - InvalidArgumentException
And those are 2 last lines from stack trace:
2. at FormConfigBuilder ::validateName ('s547b0ee70b0ac5.07768096')
in /cygdrive/c/xampp/htdocs/wzp/vendor/symfony/symfony/src/Symfony/Component/Form/FormConfigBuilder.php at line 193
3. at FormConfigBuilder ->__construct ('s547b0ee70b0ac5.07768096', 'Backend\PoiBundle\Entity\Obiektydziedzictwa', object(EventDispatcher), array('block_name' => null, 'disabled' => false, 'label' => null, 'attr' => array(), 'translation_domain' => null, 'auto_initialize' => true, 'empty_data' => object(Closure), 'trim' => true, 'required' => true, 'read_only' => false, 'max_length' => null, 'pattern' => null, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'error_bubbling' => true, 'label_attr' => array(), 'virtual' => null, 'inherit_data' => false, 'compound' => true, 'method' => 'POST', 'action' => '', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'validation_groups' => null, 'error_mapping' => array(), 'constraints' => array(), 'cascade_validation' => false, 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'extra_fields_message' => 'This form should not contain extra fields.', 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'csrf_token_manager' => object(CsrfProviderAdapter), 'csrf_token_id' => null, 'csrf_provider' => object(CsrfTokenManagerAdapter), 'intention' => null, 'sonata_admin' => null, 'sonata_field_description' => null, 'label_render' => true, 'sonata_help' => null, 'horizontal_label_class' => '', 'horizontal_label_offset_class' => '', 'horizontal_input_wrapper_class' => '', 'data_class' => 'Backend\PoiBundle\Entity\Obiektydziedzictwa'))
in /cygdrive/c/xampp/htdocs/wzp/vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php at line 51
As I said before, there is no problem with running such function at my application on ubuntu.
The cygwin is hosted on Windows 7 64-bit
I didn't configured php.ini despite increasing memory_limit and setting date.timezone.
Theese are my php modules:
curl.ini gd.ini gmp.ini gv.ini
iconv.ini intl.ini json.ini mysql.ini
mysqli.ini pdo_dblib.ini pdo_mysql.ini pdo_pgsql.ini
pdo_sqlite.ini pgsql.ini phpmodules pspell.ini
readline.ini simplexml.ini sqlite3.ini tidy.ini
If I run the same project from xampp on windows there is also no such problem as described above.
Does anyone run symfony project under apache + php on cygwin?
Any help appreciated.
If I run cygwin 32-bit (on the same Windows 7 64-bit) I don't get this error. But another problem occurred. Somehow sonata generates paths like:
Which is the reason why I get an error: There is no such file.
回答 1 已采纳
Issue with Errors
Have been using Emacs for a couple years. Recently decided to try the Prelude version (link to prelude). Install went smoothly (on Win7 with Cygwin), but have been unable to use php error checking for a couple days. I want to get php error checking to work with Flycheck. It is non-functioning for me right now.
Currently, when I break a php script, flycheck.el (@ln2551) returns 2 errors:
Checker php returned non-zero exit code 1, but no errors from output:
Could not open input file: /tmp/flycheck4728Btc/myPhpFile.php
Checker definition probably flawed.
Checker php-phpcs returned non-zero exit code 1, but no errors from output:
Could not open input file: /cygdrive/c/xampp/php/phpcs
Checker definition probably flawed.
1). Flycheck writes a buffer copy in Cygwin root /tmp directory. See flycheck.el (@ln800)):
This file exists and is a confirmed readable buffer copy; there is no a problem with its file permissions (same error whether chmod 777 or 700).
2). Phpcs is located at c:/xampp/php/phpcs and can be called from the command line (cmd.exe and cygwin bash) with or without the c:/ path; but does not work with the cygdrive path. [This does NOT work $/cydrive/c/xampp/php/phpcs -h (with or without the .bat extension).] I have also confirmed good installation of phpcs (and it works from command line), and that there is not a file permission issue here. I have set the flychech-phpcs-standard variable to c:/xampp/php/phpcs as per flycheck.el @ln2895-2903 but have not found the condition that throws throws the error.
[Note: This error did go away when I tried renaming the phpcs file and specifying the phpcs.bat, but I am not sure sure whether the checker was found or not since the write to tmp file error still thwarted any results. Also, that broke my commandline usage of the phpcs command.]
Just to be sure, here is my php -v:
$ php -v
PHP 5.4.7 (cli) (built: Sep 12 2012 23:48:31)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans
Here is my phpcs version:
$ phpcs --version
PHP_CodeSniffer version 1.3.3 (stable) by Squiz Pty Ltd. (http://www.squiz.net)
And have this alias in my .bash_profile:
And c:\xampp\php on my PATH
I been going through the phpcs, cygwin, and the flycheck.el, including the instructions to customize the flycheck-phpcs-standard lines and have not made any progress on this issue.
I am unsure whether this has something to do with the comments on flycheck.el@800-824 (defun flycheck-temp-file-system (filename prefix) or not. Those are comments about hacking around a compression bug with Emacs. Anyway,
How to fix this?
Any comments or ideas to test this further? Anyone have flycheck working on win7 with Cygwin? Is it an operating systemn compile issue? Directory paths in scripts somewhere?
回答 1 已采纳
I struggle to be able to run PHP client line interface on Cygwin. I receive constantly Segmentation fault error. But some of functions are correctly done - I cannot say when does it happen.
If somebody had this error, please give me any clue to correctly run PHP CLI under cygwin.
Thanks in advance!
I Receive stackdump, but I don't know if it tells anything:
Exception: STATUS_ACCESS_VIOLATION at eip=603B7AC6
eax=0000000A ebx=FFE42FFF ecx=002853E0 edx=FFE43000 esi=00000000 edi=FFE43000
ebp=002853E2 esp=00285240 program=C:\cygwin\bin\php.exe, pid 10056, thread main
cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B
Frame Function Args
002853E2 603B7AC6 (022A018F, 02D40284, 0348030B, 0374034D)
00040002 00F30055 (00340000, 01E00000, 020C0000, 00360000)
Moreover I tried to limit in php.ini
It crashes every time when I work with client line interface. If I run it through Apache2 there is no problem.
How can I debug it effectively?
I run it with php-cgi, where I receive the html output with error description:
ContextErrorException: Warning: Invalid argument supplied for foreach() in ...
Having this information I guess that there is a problem with input arguments. If I run scripts without arguments from console I don't receive segmentation fault.
This is Symfony framework and those scripts run like a charm on windows and ubuntu on console. So I guess:
- there is something wrong with PHP settings
- there is something wrong with console on Cygwin
Any idea how can I debug it more?