" URL not found 404 error" after the 3rd page during Magento installation - magento

I have been trying to install Magento 1.6 latest version and sample data magento sample-data- 1.1.2 but all in vain.I cannot get past the 3rd page,where database,username,URL etc information is added.When I click the continue button,I get 404 error “URL not found“ .After google search I found out that some guys reported similar problems that lead to some php files accessing the Mysql server.Those files seemed to have a syntax error of some kind.My problem is of similar nature but leads to a diffrent php file having an 'an access voilation'error.The url points to the report directory inside magento/var.
This is my report file in Public_html/magento/var/report
a:5:{i:0;s:223:"Error in file: "/home/archy/public_html/magento/app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.2-0.8.3.php" - SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'AX' for key 'PRIMARY'";i:1;s:1022:"#0 /home/archy/public_html/magento/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
I don’t understand how to solve the problem.Has anyone experienced similar problems.
New Addition..
I am really struggling with Magento!! I tried to install magento on my desktop(local server) after a failed attempt on my laptop(above).But I get I "Object not found error 404" after clicking the continue button in the configuration section of my installation.I have double checked my permissions on media, var,app directories.They are all 777.Sample date was installed before starting installation.The only option that I commented out in .htaccess was the the ExpireDefault which was causing "Internal Server Error"before being removed.
Here is the stack trace:
Mage_Core_Exception: Can't retrieve entity config: sales/quote_shipping_rate in /home/sam/public_html/magento/app/Mage.php on line 563
Call Stack:
0.0296 644264 1. {main}() /home/sam/public_html/magento/index.php:0
0.1808 1129872 2. Mage::run() /home/sam/public_html/magento/index.php:80
0.3326 2771544 3. Mage_Core_Model_App->run() /home/sam/public_html/magento/app/Mage.php:640
1.0335 4165088 4. Mage_Core_Model_App->_initModules() /home/sam/public_html/magento/app/code/core/Mage/Core/Model/App.php:338
5.2513 4490984 5. Mage_Core_Model_Resource_Setup::applyAllUpdates() /home/sam/public_html/magento/app/code/core/Mage/Core/Model/App.php:412
7.1161 9860936 6. Mage_Core_Model_Resource_Setup->applyUpdates() /home/sam/public_html/magento/app/code/core/Mage/Core/Model/Resource/Setup.php:235
7.1163 9861520 7. Mage_Core_Model_Resource_Setup->_upgradeResourceDb() /home/sam/public_html/magento/app/code/core/Mage/Core/Model/Resource/Setup.php:320
7.1163 9861600 8. Mage_Core_Model_Resource_Setup->_modifyResourceDb() /home/sam/public_html/magento/app/code/core/Mage/Core/Model/Resource/Setup.php:437
7.1792 9917352 9. include('/home/sam/public_html/magento/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.16-0.9.17.php') /home/sam/public_html/magento/app/code/core/Mage/Core/Model/Resource/Setup.php:624
7.1810 9918112 10. Mage_Sales_Model_Resource_Setup->addAttribute() /home/sam/public_html/magento/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.16-0.9.17.php:32
7.1810 9918112 11. Mage_Sales_Model_Resource_Setup->_flatTableExist() /home/sam/public_html/magento/app/code/core/Mage/Sales/Model/Resource/Setup.php:101
12.4649 9964680 12. Mage_Core_Model_Resource_Setup->getTable() /home/sam/public_html/magento/app/code/core/Mage/Sales/Model/Resource/Setup.php:87
12.4649 9964680 13. Mage_Core_Model_Resource->getTableName() /home/sam/public_html/magento/app/code/core/Mage/Core/Model/Resource/Setup.php:184
12.5666 10576032 14. Mage::throwException() /home/sam/public_html/magento/app/code/core/Mage/Core/Model/Resource.php:272
)
I couldn't find out what could have caused the problem.Help needed.
Thank you.

Check with the below script if your server or local meets the requirement to install magento
function extension_check($extensions) {
$fail = '';
if(version_compare(phpversion(), '5.2.0', '<')) {
$fail .= '<li>PHP 5.2.0 (or greater)</li>';
}
if(!ini_get('safe_mode')) {
if(preg_match('/[0-9].[0-9]+.[0-9]+/', shell_exec('mysql -V'), $version)) {
if(version_compare($version[0], '4.1.20', '<')) {
$fail .= '<li>MySQL 4.1.20 (or greater)</li>';
}
}
}
foreach($extensions as $extension) {
if(!extension_loaded($extension)) {
$fail .= '<li>'.$extension.'</li>';
}
}
if($fail) {
echo '<p>Your server does not meet the requirements for Magento.';
echo 'The following requirements failed:</p>';
echo '<ul>'.$fail.'</ul>';
} else {
echo '<p>Congratulations! Your server meets the requirements for Magento.</p>';
}
}
?>
STEP 2 : CHeck Max Execution time
Step 3: Install the Magento again with the version 1.6.0.0 as there were some problem at the first release or try with latest version 1.6.2.0
Let me know if it works or not

Related

Laravel sporadic EncryptException "Could not encrypt the data." in EncryptCookies

We have a CentOS LAMP server with PHP5.6.37, openSSL 1.0.2, Laravel 5.4.
Sporadically we receive the following error:
exception 'Illuminate\Contracts\Encryption\EncryptException' with message 'Could not encrypt the data.' in ./Illuminate/Encryption/Encrypter.php:95
Stack trace:
#0 ./Illuminate/Cookie/Middleware/EncryptCookies.php(131): Illuminate\Encryption\Encrypter->encrypt('KoKVTECWZF4A8x7...')
#1 ./Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Cookie\Middleware\EncryptCookies->encrypt(Object(Illuminate\Http\Response))
The problematic code is:
$json = json_encode(compact('iv', 'value', 'mac'));
if (!is_string($json)) {
throw new EncryptException('Could not encrypt the data.');
}
These exceptions happen sporadically, all in the early morning hours (3AM-8AM) , sometimes there are no errors for couple of weeks, then they happen every consecutive day.
ATM we cannot switch to PHP7.
EDIT 1:
I have logged the values, where the program crashes during the night. If I rerun the code, I get normal response without an Exception.
$value = 'a51446732955fcf3bb467fc135741ae7956dc247d562b16157de231b8d792400';
$mac = 'Xdo0mGNCeX4p2AHj4cgbmounu3F2bql05uSmve7DDmUWpmMJ1ysmsSrGPg+57N52FxqszqDU5PBTGMihan7ZZQ==';
echo json_encode(compact('iv', 'value', 'mac'));
1{"iv":"yHUQHrhaXq7T+VikdvXuqQ==","value":"a51446732955fcf3bb467fc135741ae7956dc247d562b16157de231b8d792400","mac":"Xdo0mGNCeX4p2AHj4cgbmounu3F2bql05uSmve7DDmUWpmMJ1ysmsSrGPg+57N52FxqszqDU5PBTGMihan7ZZQ=="}```

Need some guidance regarding Elasticsearch php

I need some help in understanding the following things,
I am using composer for elasticsearch php integration. I have created a html page to post form data into elasticsearch. I am trying to access the html page from another pc by changing the localhost ip to the system ip where i have hosted the html page. But i'm getting error.
Fatal error: Uncaught Elasticsearch\Common\Exceptions\NoNodesAvailableException: No alive nodes found in your cluster in C:\xampp\htdocs\Client_portal\vendor\elasticsearch\elasticsearch\src\Elasticsearch\ConnectionPool\StaticNoPingConnectionPool.php:50 Stack trace: #0 C:\xampp\htdocs\Client_portal\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Transport.php(77): Elasticsearch\ConnectionPool\StaticNoPingConnectionPool->nextConnection() #1 C:\xampp\htdocs\Client_portal\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Transport.php(94): Elasticsearch\Transport->getConnection() #2 C:\xampp\htdocs\Client_portal\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Connections\Connection.php(269): Elasticsearch\Transport->performRequest('POST', '/sib_api/_doc', Array, '{"requestid":"#...', Array) #3 C:\xampp\htdocs\Client_portal\vendor\react\promise\src\FulfilledPromise.php(25): Elasticsearch\Connections\Connection->Elasticsearch\Connections{closure}(Array) #4 C:\xampp\htdocs\Client_portal\vendor\guzzlehttp\ringphp\sr in C:\xampp\htdocs\Client_portal\vendor\elasticsearch\elasticsearch\src\Elasticsearch\ConnectionPool\StaticNoPingConnectionPool.php on line 50
To resolve the above issue i tried to call the autoload.php file using the complete path (i.e) http://localhost:8080/client_portal/vendor/autoload.php
But now I am getting another error
Fatal error: Uncaught Error: Class 'Elasticsearch\ClientBuilder' not found in C:\xampp\htdocs\Client_portal\Elastic_api.php:19 Stack trace: #0 {main} thrown in C:\xampp\htdocs\Client_portal\Elastic_api.php on line 19
Could someone help me to resolve this issue... and also guide me how to access my html page from another system without any isssues.
<?php
session_start();
$Engagement = $_SESSION["Engagement"];
$Application = $_SESSION["Application"];
$Priority = $_SESSION["Priority"];
$Requestid = $_SESSION["Requestid"];
$_SESSION["URL"] = $_POST['url'];
$_SESSION["REQ"] = $_POST['request'];
$_SESSION["RES"] = $_POST['response'];
$_SESSION["yn"] = $_POST['YN'];
$_SESSION["START"] = $_POST['start'];
$_SESSION["END"] = $_POST['end'];
if (isset($_POST['Submit2']))
{
require 'http://localhost:8080/client_portal/vendor/autoload.php';
$client = Elasticsearch\ClientBuilder::create()->build();
// the above line is where i'm getting the error...

Magento 2 invalid template exception just after installation

I have installed the Magento 2.0 platform on my localhost today. After completing all the setup and installation, when I tried to open the admin panel, it was showing a brown blank screen. When I switched to the developer mode, it is showing an invalid template error for require_js.phtml. The complete error is :
1 exception(s):
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'C:/xampp/htdocs/magento_demo/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml' in module: 'Magento_Backend' block's name: 'require.js'
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'C:/xampp/htdocs/magento_demo/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml' in module: 'Magento_Backend' block's name: 'require.js'
#0 C:\xampp\htdocs\magento_demo\vendor\magento\framework\View\Element\Template.php(301): Magento\Framework\View\Element\Template->fetchView('C:/xampp/htdocs...')
#1 C:\xampp\htdocs\magento_demo\vendor\magento\framework\View\Element\AbstractBlock.php(668): Magento\Framework\View\Element\Template->_toHtml()
#2 C:\xampp\htdocs\magento_demo\vendor\magento\framework\View\Result\Page.php(249): Magento\Framework\View\Element\AbstractBlock->toHtml()
#3 C:\xampp\htdocs\magento_demo\vendor\magento\framework\View\Result\Layout.php(171): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#4 C:\xampp\htdocs\magento_demo\generated\code\Magento\Backend\Model\View\Result\Page\Interceptor.php(193): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#5 C:\xampp\htdocs\magento_demo\vendor\magento\framework\App\Http.php(139): Magento\Backend\Model\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#6 C:\xampp\htdocs\magento_demo\generated\code\Magento\Framework\App\Http\Interceptor.php(24): Magento\Framework\App\Http->launch()
#7 C:\xampp\htdocs\magento_demo\vendor\magento\framework\App\Bootstrap.php(258): Magento\Framework\App\Http\Interceptor->launch()
#8 C:\xampp\htdocs\magento_demo\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#9 {main}
I have never used Magento before and have no idea what the issue is or how to solve it. Can anyone tell me what to do to solve the issue?
You can execute composer update from project root it will update all missing dependencies.
Other then this it you can flush Magento cache and re deploy static content, follow these steps:
1) php bin/magento cache:flush or (sudo rm -rf <magento-root>/var/generated/* <magento-root>/pub/static/*)
2) php bin/magento setup:static-content:deploy
Now clean you browser cache and reload the page.
Yes, This is the problem with windows. Windows uses "" as separator, the array "directories" contains entries with "/" as separator, so the check will always fail. So you need to fix this by replacing the separator in core file:
Magento\Framework\View\Element\Template\File\Validator
function isPathInDirectories replace below code in isPathInDirectories function
$realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
How to fix Invalid template file error in Magento2 after version upgrade?
In case of windows, just replace this function isPathInDirectories in vendor/magento/framework/view/element/template/file/validator.php
protected function isPathInDirectories($path, $directories)
{
$realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
if (!is_array($directories)) {
$directories = (array)$directories;
}
foreach ($directories as $directory) {
if (0 === strpos($realPath, $directory)) {
return true;
}
}
return false;
}

Magento 1.9 cannot make customer login, undefined offset + undefined variable

I have a really strange problem. Yesterday I was working with magento just fine and today when I opened the pc and tried login on my account after cleaning cache & session it gives me this error on customer login:
Error occurred. Please try again later on the frontend.
I dig into the system.log and I have this:
ERR (3): Notice: Undefined offset: 158 in {...}/phpseclib/Math/BigInteger.php on line 3426 and 3317
ERR (3): Notice: Undefined variable: cmsPageIdentifier in {...}/default/template/page/html/header.phtml on line 29
and this is the code in question
Line 7-10:
if(Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')
{
$cmsPageIdentifier = Mage::getSingleton('cms/page')->getIdentifier();
}
Line 29:
<?php elseif ($cmsPageIdentifier && $cmsPageIdentifier == "conferma-invio") : ?>
In sso.log I have this
DEBUG (7): HTTP status: 503 when trying to get user authentication
DEBUG (7): Field Status was empty in webapi response
Thank you.
I manually fixed the BigInteger and I remained only with the sso.log.
Dug into it and I found that there was another module error blocking customer login. Setting that module to false in app/etc/modules/Module_Name.xml fixed it.

Laravel 4 - Warning: Illegal offset type in isset or empty in \bootstrap\compiled.php

I'm having a hard time installing Laravel 4 on Windows 8 + Xampp.
Here's the setup:
- Xampp 1.8.1
- Composer is installed globally
I install Laravel with the usual "composer create-project laravel/laravel projectname". It installs fine.
But when I navigate to the public folder of the framework, I get dozens of Warning: Illegal offset type in isset or empty in \bootstrap\compiled.php errors.
On lines : 439, 221, 137, 154. The 4 errors are repeated indefinitely until the request times out.
Troubleshooting done so far:
- Tried on 2 seperate machines with the same setup.
- Re-ran Composer update.
- Instead of using create-project, I downloaded the framework and ran Composer install.
- Tried to setup up virtual hosts instead of accessing localhost/projectname/public.
- Searched online for 2 hours. Read every Laravel 4 install tutorial.
Any clues on what I might be doing wrong?
Thanks
-- EDIT --
Here are the lines causing the problem inside of compiled.php
Line 137 section :
$abstract = $this->getAlias($abstract);
if (isset($this->instances[$abstract])) {
return $this->instances[$abstract];
}
Line 154 section :
protected function getConcrete($abstract)
{
if (!isset($this->bindings[$abstract])) {
return $abstract;
} else {
return $this->bindings[$abstract]['concrete'];
}
}
Line 221 section :
protected function getAlias($abstract)
{
return isset($this->aliases[$abstract]) ? $this->aliases[$abstract] : $abstract;
}
Line 439 section :
public function make($abstract, $parameters = array())
{
if (isset($this->deferredServices[$abstract])) {
$this->loadDeferredProvider($abstract);
}
return parent::make($abstract, $parameters);
}
-- NEW FIND --
Using Wampserver works, instead of using Xampp.
Encountered the same error when using Xampp. I fixed it by disabling the eAccelerator extension in php.ini. Try commenting out the following line: zend_extension = "path\to\xampp\php\ext\php_eaccelerator_ts.dll" in your php.ini file.

Resources