Captcha will not be shown on screen

2020-05-10T22:00:00Z
Hi yii2-coder,
Following code will not show captcha picture, neither online (apache2/Pi/MySQL) nor under Netbeans(Win10, XAMPP)
Here is screenshot of Chrome using my Pi…
captch_error
…Here is Website…:

…and here is code of Netbeans.
On LINUX, I fired following order:" chmod 777 /var/www/html/yii2_ErkanImmo/frontend/views/site/contact.php => no successs=> What am I doing wrong… Where is the Bug?

`  <div class="row">
                                                        <span class="wpcf7-form-control-wrap your-message">
                                                            <?=
                                                            $form->field($model, 'inhalt')->textarea(['style' => ['width' => '558px'], 'rows' => 10]);
                                                            ?>
                                                        </span>
                                                        <?=
                                                        $form->field($model, 'verifyCode')->widget(Captcha::className(), [
                                                            'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>',
                                                        ])
                                                        ?>
                                                        <?= Html::submitButton('Absenden', ['class' => 'absenden', 'name' => 'contact-button']) ?>
 </div>

`

  1. Do you have GD or Imagick installed?
  2. Anything in logs?
  3. What do you have in browser’s inspector, Network tab?

It run a long time very well, suddenly, captha has been disapeared. So, I don’t think, matter is missing any library. I use for an non-Yii2-PHP-Project another Graphic Library
What logs do you mean?Where can I find them?
Following upload will show Network tab

Do not assume. Check it. A server update may remove packages or change configs.

Yii logs. <where your app is>/runtime/logs/*

Hi Samdark. Unfortunately, theres is no possibillity any more, quellcode uploding as quellcode I could upload log as an image, but it’s to large.
I’m starting to think the whole project coding in yi22 will never come to an end. I loved U and kartik as great supporter and coder, but ,actually, nothing seems to function. If even standard functinos will not do functions as before, something seems to be strange. :exploding_head:

The more I try, the worser it will get, see:
Captcha

Here is runtime/logs/app.log, after having deleted all entries before calling capthcha again(from Netbeans-respecectively developpment mode)!!

2020-05-23 15:02:38 [::1][-][-][warning][yii\web\Session::init] Session is already started
in X:\xampp\htdocs\yii2_ErkanImmo\frontend\views\site\index.php:12
in X:\xampp\htdocs\yii2_ErkanImmo\frontend\controllers\SiteController.php:61
2020-05-23 15:02:38 [::1][-][-][warning][yii\i18n\PhpMessageSource::loadMessages] The message file for category ‘app’ does not exist: X:\xampp\htdocs\yii2_ErkanImmo\frontend/messages/de/app.php
in X:\xampp\htdocs\yii2_ErkanImmo\frontend\views\site\index.php:41
in X:\xampp\htdocs\yii2_ErkanImmo\frontend\controllers\SiteController.php:61
2020-05-23 15:02:38 [::1][-][-][info][application] $_GET = []

$_POST = []

$_FILES = []

$_COOKIE = []

$_SESSION = [
‘__flash’ => []
]

$_SERVER = [
‘MIBDIRS’ => ‘X:/xampp/php/extras/mibs’
‘MYSQL_HOME’ => ‘\xampp\mysql\bin’
‘OPENSSL_CONF’ => ‘X:/xampp/apache/bin/openssl.cnf’
‘PHP_PEAR_SYSCONF_DIR’ => ‘\xampp\php’
‘PHPRC’ => ‘\xampp\php’
‘TMP’ => ‘\xampp\tmp’
‘HTTP_HOST’ => ‘localhost:8080’
‘HTTP_CONNECTION’ => ‘keep-alive’
‘HTTP_UPGRADE_INSECURE_REQUESTS’ => ‘1’
‘HTTP_USER_AGENT’ => ‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36’
‘HTTP_SEC_FETCH_DEST’ => ‘document’
‘HTTP_ACCEPT’ => ‘text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9’
‘HTTP_SEC_FETCH_SITE’ => ‘none’
‘HTTP_SEC_FETCH_MODE’ => ‘navigate’
‘HTTP_SEC_FETCH_USER’ => ‘?1’
‘HTTP_ACCEPT_ENCODING’ => ‘gzip, deflate, br’
‘HTTP_ACCEPT_LANGUAGE’ => ‘de,en;q=0.9’
‘PATH’ => ‘C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;X:\Program Files\Python37\Scripts\;X:\Program Files\Python37\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\PuTTY\;X:\xampp\php;C:\composer;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;X:\metasploit-framework\bin\;X:\Users\tklustig\AppData\Local\Programs\Python\Python37\Scripts\;X:\Users\tklustig\AppData\Local\Programs\Python\Python37\;X:\Users\tklustig\AppData\Local\Programs\Python\Python37-32\Scripts\;X:\Users\tklustig\AppData\Local\Programs\Python\Python37-32\;C:\Users\tklustig\AppData\Local\Microsoft\WindowsApps;C:\Users\tklustig\AppData\Roaming\Composer\vendor\bin;C:\Users\tklustig\AppData\Local\Programs\Fiddler;C:\Users\tklustig\AppData\Local\Microsoft\WindowsApps;X:\Users\tklustig\AppData\Local\Programs\Fiddler’
‘SystemRoot’ => ‘C:\Windows’
‘COMSPEC’ => ‘C:\Windows\system32\cmd.exe’
‘PATHEXT’ => ‘.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC’
‘WINDIR’ => ‘C:\Windows’
‘SERVER_SIGNATURE’ => 'Apache/2.4.37 (Win32) OpenSSL/1.1.1a PHP/7.2.13 Server at localhost Port 8080

‘SERVER_SOFTWARE’ => ‘Apache/2.4.37 (Win32) OpenSSL/1.1.1a PHP/7.2.13’
‘SERVER_NAME’ => ‘localhost’
‘SERVER_ADDR’ => ‘::1’
‘SERVER_PORT’ => ‘8080’
‘REMOTE_ADDR’ => ‘::1’
‘DOCUMENT_ROOT’ => ‘X:/xampp/htdocs’
‘REQUEST_SCHEME’ => ‘http’
‘CONTEXT_PREFIX’ => ‘’
‘CONTEXT_DOCUMENT_ROOT’ => ‘X:/xampp/htdocs’
‘SERVER_ADMIN’ => ‘postmaster@localhost’
‘SCRIPT_FILENAME’ => ‘X:/xampp/htdocs/yii2_ErkanImmo/frontend/web/index.php’
‘REMOTE_PORT’ => ‘51540’
‘GATEWAY_INTERFACE’ => ‘CGI/1.1’
‘SERVER_PROTOCOL’ => ‘HTTP/1.1’
‘REQUEST_METHOD’ => ‘GET’
‘QUERY_STRING’ => ‘’
‘REQUEST_URI’ => ‘/yii2_ErkanImmo/frontend/web/index.php’
‘SCRIPT_NAME’ => ‘/yii2_ErkanImmo/frontend/web/index.php’
‘PHP_SELF’ => ‘/yii2_ErkanImmo/frontend/web/index.php’
‘REQUEST_TIME_FLOAT’ => 1590238958.73
‘REQUEST_TIME’ => 1590238958
]
2020-05-23 15:02:39 [::1][-][-][warning][yii\web\Session::init] Session is already started
in X:\xampp\htdocs\yii2_ErkanImmo\frontend\views\site\index.php:12
in X:\xampp\htdocs\yii2_ErkanImmo\frontend\controllers\SiteController.php:61
2020-05-23 15:02:39 [::1][-][-][warning][yii\i18n\PhpMessageSource::loadMessages] The message file for category ‘app’ does not exist: X:\xampp\htdocs\yii2_ErkanImmo\frontend/messages/de/app.php
in X:\xampp\htdocs\yii2_ErkanImmo\frontend\views\site\index.php:41
in X:\xampp\htdocs\yii2_ErkanImmo\frontend\controllers\SiteController.php:61
2020-05-23 15:02:39 [::1][-][-][info][application] $_GET = []

$_POST = []

$_FILES = []

$_COOKIE = [
‘advanced-frontend’ => ‘h1taq731lspdf2hb6s5aa4ed25’
‘_csrf-frontend’ => ‘c8968c24f3241900df92207c0c6d5e7eb2adfb22ea72d63a71eaf03f72513b49a:2:{i:0;s:14:"_csrf-frontend";i:1;s:32:“7NS3eZeNkHgaboB5rftS8jP2Bq8d4BOa”;}’
]

$_SESSION = [
‘__flash’ => []
]

$_SERVER = [
‘MIBDIRS’ => ‘X:/xampp/php/extras/mibs’
‘MYSQL_HOME’ => ‘\xampp\mysql\bin’
‘OPENSSL_CONF’ => ‘X:/xampp/apache/bin/openssl.cnf’
‘PHP_PEAR_SYSCONF_DIR’ => ‘\xampp\php’
‘PHPRC’ => ‘\xampp\php’
‘TMP’ => ‘\xampp\tmp’
‘HTTP_HOST’ => ‘localhost:8080’
‘HTTP_CONNECTION’ => ‘keep-alive’
‘HTTP_PRAGMA’ => ‘no-cache’
‘HTTP_CACHE_CONTROL’ => ‘no-cache’
‘HTTP_UPGRADE_INSECURE_REQUESTS’ => ‘1’
‘HTTP_USER_AGENT’ => ‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36’
‘HTTP_SEC_FETCH_DEST’ => ‘document’
‘HTTP_ACCEPT’ => ‘text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9’
‘HTTP_SEC_FETCH_SITE’ => ‘none’
‘HTTP_SEC_FETCH_MODE’ => ‘navigate’
‘HTTP_SEC_FETCH_USER’ => ‘?1’
‘HTTP_ACCEPT_ENCODING’ => ‘gzip, deflate, br’
‘HTTP_ACCEPT_LANGUAGE’ => ‘de,en;q=0.9’
‘HTTP_COOKIE’ => ‘advanced-frontend=h1taq731lspdf2hb6s5aa4ed25; _csrf-frontend=c8968c24f3241900df92207c0c6d5e7eb2adfb22ea72d63a71eaf03f72513b49a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%227NS3eZeNkHgaboB5rftS8jP2Bq8d4BOa%22%3B%7D’
‘PATH’ => ‘C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;X:\Program Files\Python37\Scripts\;X:\Program Files\Python37\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\PuTTY\;X:\xampp\php;C:\composer;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;X:\metasploit-framework\bin\;X:\Users\tklustig\AppData\Local\Programs\Python\Python37\Scripts\;X:\Users\tklustig\AppData\Local\Programs\Python\Python37\;X:\Users\tklustig\AppData\Local\Programs\Python\Python37-32\Scripts\;X:\Users\tklustig\AppData\Local\Programs\Python\Python37-32\;C:\Users\tklustig\AppData\Local\Microsoft\WindowsApps;C:\Users\tklustig\AppData\Roaming\Composer\vendor\bin;C:\Users\tklustig\AppData\Local\Programs\Fiddler;C:\Users\tklustig\AppData\Local\Microsoft\WindowsApps;X:\Users\tklustig\AppData\Local\Programs\Fiddler’
‘SystemRoot’ => ‘C:\Windows’
‘COMSPEC’ => ‘C:\Windows\system32\cmd.exe’
‘PATHEXT’ => ‘.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC’
‘WINDIR’ => ‘C:\Windows’
‘SERVER_SIGNATURE’ => 'Apache/2.4.37 (Win32) OpenSSL/1.1.1a PHP/7.2.13 Server at localhost Port 8080

‘SERVER_SOFTWARE’ => ‘Apache/2.4.37 (Win32) OpenSSL/1.1.1a PHP/7.2.13’
‘SERVER_NAME’ => ‘localhost’
‘SERVER_ADDR’ => ‘::1’
‘SERVER_PORT’ => ‘8080’
‘REMOTE_ADDR’ => ‘::1’
‘DOCUMENT_ROOT’ => ‘X:/xampp/htdocs’
‘REQUEST_SCHEME’ => ‘http’
‘CONTEXT_PREFIX’ => ‘’
‘CONTEXT_DOCUMENT_ROOT’ => ‘X:/xampp/htdocs’
‘SERVER_ADMIN’ => ‘postmaster@localhost’
‘SCRIPT_FILENAME’ => ‘X:/xampp/htdocs/yii2_ErkanImmo/frontend/web/index.php’
‘REMOTE_PORT’ => ‘51539’
‘GATEWAY_INTERFACE’ => ‘CGI/1.1’
‘SERVER_PROTOCOL’ => ‘HTTP/1.1’
‘REQUEST_METHOD’ => ‘GET’
‘QUERY_STRING’ => ‘’
‘REQUEST_URI’ => ‘/yii2_ErkanImmo/frontend/web/index.php’
‘SCRIPT_NAME’ => ‘/yii2_ErkanImmo/frontend/web/index.php’
‘PHP_SELF’ => ‘/yii2_ErkanImmo/frontend/web/index.php’
‘REQUEST_TIME_FLOAT’ => 1590238959.148
‘REQUEST_TIME’ => 1590238959
]
2020-05-23 15:02:43 [::1][-][-][warning][yii\i18n\PhpMessageSource::loadMessages] The message file for category ‘app’ does not exist: X:\xampp\htdocs\yii2_ErkanImmo\frontend/messages/de/app.php
in X:\xampp\htdocs\yii2_ErkanImmo\frontend\views\site\contact.php:114
in X:\xampp\htdocs\yii2_ErkanImmo\frontend\controllers\SiteController.php:117
2020-05-23 15:02:43 [::1][-][-][info][application] $_GET = []

$_POST = []

$_FILES = []

$_COOKIE = [
‘advanced-frontend’ => ‘h1taq731lspdf2hb6s5aa4ed25’
‘_csrf-frontend’ => ‘c8968c24f3241900df92207c0c6d5e7eb2adfb22ea72d63a71eaf03f72513b49a:2:{i:0;s:14:"_csrf-frontend";i:1;s:32:“7NS3eZeNkHgaboB5rftS8jP2Bq8d4BOa”;}’
]

$_SESSION = [
‘__flash’ => []
‘__captcha/site/captcha’ => ‘luiobob’
‘__captcha/site/captchacount’ => 1
]

$_SERVER = [
‘MIBDIRS’ => ‘X:/xampp/php/extras/mibs’
‘MYSQL_HOME’ => ‘\xampp\mysql\bin’
‘OPENSSL_CONF’ => ‘X:/xampp/apache/bin/openssl.cnf’
‘PHP_PEAR_SYSCONF_DIR’ => ‘\xampp\php’
‘PHPRC’ => ‘\xampp\php’
‘TMP’ => ‘\xampp\tmp’
‘HTTP_HOST’ => ‘localhost:8080’
‘HTTP_CONNECTION’ => ‘keep-alive’
‘HTTP_UPGRADE_INSECURE_REQUESTS’ => ‘1’
‘HTTP_USER_AGENT’ => ‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36’
‘HTTP_SEC_FETCH_DEST’ => ‘document’
‘HTTP_ACCEPT’ => ‘text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9’
‘HTTP_SEC_FETCH_SITE’ => ‘same-origin’
‘HTTP_SEC_FETCH_MODE’ => ‘navigate’
‘HTTP_SEC_FETCH_USER’ => ‘?1’
‘HTTP_REFERER’ => ‘http://localhost:8080/yii2_ErkanImmo/frontend/web/index.php
‘HTTP_ACCEPT_ENCODING’ => ‘gzip, deflate, br’
‘HTTP_ACCEPT_LANGUAGE’ => ‘de,en;q=0.9’
‘HTTP_COOKIE’ => ‘advanced-frontend=h1taq731lspdf2hb6s5aa4ed25; _csrf-frontend=c8968c24f3241900df92207c0c6d5e7eb2adfb22ea72d63a71eaf03f72513b49a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%227NS3eZeNkHgaboB5rftS8jP2Bq8d4BOa%22%3B%7D’
‘PATH’ => ‘C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;X:\Program Files\Python37\Scripts\;X:\Program Files\Python37\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\PuTTY\;X:\xampp\php;C:\composer;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;X:\metasploit-framework\bin\;X:\Users\tklustig\AppData\Local\Programs\Python\Python37\Scripts\;X:\Users\tklustig\AppData\Local\Programs\Python\Python37\;X:\Users\tklustig\AppData\Local\Programs\Python\Python37-32\Scripts\;X:\Users\tklustig\AppData\Local\Programs\Python\Python37-32\;C:\Users\tklustig\AppData\Local\Microsoft\WindowsApps;C:\Users\tklustig\AppData\Roaming\Composer\vendor\bin;C:\Users\tklustig\AppData\Local\Programs\Fiddler;C:\Users\tklustig\AppData\Local\Microsoft\WindowsApps;X:\Users\tklustig\AppData\Local\Programs\Fiddler’
‘SystemRoot’ => ‘C:\Windows’
‘COMSPEC’ => ‘C:\Windows\system32\cmd.exe’
‘PATHEXT’ => ‘.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC’
‘WINDIR’ => ‘C:\Windows’
‘SERVER_SIGNATURE’ => 'Apache/2.4.37 (Win32) OpenSSL/1.1.1a PHP/7.2.13 Server at localhost Port 8080

‘SERVER_SOFTWARE’ => ‘Apache/2.4.37 (Win32) OpenSSL/1.1.1a PHP/7.2.13’
‘SERVER_NAME’ => ‘localhost’
‘SERVER_ADDR’ => ‘::1’
‘SERVER_PORT’ => ‘8080’
‘REMOTE_ADDR’ => ‘::1’
‘DOCUMENT_ROOT’ => ‘X:/xampp/htdocs’
‘REQUEST_SCHEME’ => ‘http’
‘CONTEXT_PREFIX’ => ‘’
‘CONTEXT_DOCUMENT_ROOT’ => ‘X:/xampp/htdocs’
‘SERVER_ADMIN’ => ‘postmaster@localhost’
‘SCRIPT_FILENAME’ => ‘X:/xampp/htdocs/yii2_ErkanImmo/frontend/web/index.php’
‘REMOTE_PORT’ => ‘51545’
‘GATEWAY_INTERFACE’ => ‘CGI/1.1’
‘SERVER_PROTOCOL’ => ‘HTTP/1.1’
‘REQUEST_METHOD’ => ‘GET’
‘QUERY_STRING’ => ‘’
‘REQUEST_URI’ => ‘/yii2_ErkanImmo/frontend/web/index.php/contact’
‘SCRIPT_NAME’ => ‘/yii2_ErkanImmo/frontend/web/index.php’
‘PATH_INFO’ => ‘/contact’
‘PATH_TRANSLATED’ => ‘X:\xampp\htdocs\contact’
‘PHP_SELF’ => ‘/yii2_ErkanImmo/frontend/web/index.php/contact’
‘REQUEST_TIME_FLOAT’ => 1590238963.183
‘REQUEST_TIME’ => 1590238963
]

Hmm… looks weird. Check for extra spaces/characters before opening <?php in your files.

Also try deploying basic app template to the same server. It works for sure so if it doesn’t work for you the problem is in the server config. If it does work there’s an issue with project code.

It’s impossible checking all <?php ?> in all php files. Project is too huge, lots of controllers, models and views to check can’t be solution :=(
I can show U server config, if necssary. Which file of apache could help U solving problem?php.ini? Furthermore, project code already has been published. Using basic app template could solve problem, but it will be tremendous effort to convert all my code into your template :unamused:
Would U do this, really??

No. By deploying basic app template and trying to run it we’ll find out if it’s the server config to be adjusted or if it’s something in the code. By doing this we’ll take application code out of equation (temporarily).