Windows>XAMPP>Magento 2>Chrome.... Broken out of Box - php

This is the admin panel of my newly installed, unaltered install of Magento 2.2.5 in XAMPP 7.0.30 / PHP 7.0.30:
I am brand new to this, but I have done my best to find an answer or even just a solution on my own. I need help.
I do not see any folder with the path localhost/pub/static/version1532138534/adminhtml/Magento/backend/en_US/extjs/resources/css/
I've been struggling with this all week. I've fresh installed both XAMPP and Magento, trying multiple versions.
I've tried different browsers, and changing my browsers settings, and clearing my browsers.
I've tried installing XAMPP and Magento on MacOS instead, and found a new issue, that prevented me from even getting to this step, which I then banged my head against for 6 hours or so before giving up and going back to Windows.
I've pored over the web trying to find a solutions, but I can't even find anyone with the same issue.
Obviously, I am doing something wrong... and I want to know what, but I just can't seem to find any answers.

do the static content deployment.
take backup of core_config_data table
go to phpmyadmin and run insert core_config_data (config_id, scope, scope_id, path, value) values (null, 'default', 0, 'dev/static/sign', 0);
go to your magento root folder using command line.
run php bin\magento cache:flush
run php bin\magento setup:static-content:deploy -f
your problem will be resolved.

Solution:
If anyone is having the same issue, here is what worked for me.
I added "C:\xampp\php" to my system variables/path.
Search "System Properties" from the start menu and open it.(New Window)
Select the "Advanced" tab.
Click "Environment Variables". (New Window)
From "System Variables", select "Path".
Click "Edit"
Click "New"
Type "C:\xampp\php"
Hit "OK" x3.
This appears to have allowed me to use php commands in my command prompt.
Then, I ran the setup for the Magento file in "C:\xampp\htdocs\Magento\bin". (This may be redundant.)
[You can see a full list of available commands with "C:\xampp\htdocs\Magento\bin php Magento"]
Open a command prompt. (win+r, cmd, enter).
Navigate to the bin folder. (cd c:\xampp\htdocs\Magento{*this may be unique to your setup}\bin, enter)
Run the setup. (php Magento setup:install)
Finally, I deployed all static view files.
In the same directory as before deploy static files. (php Magento setup:static-content:deploy, enter)
After this, in a browser, I navigated to localhost/Magento, and ran through the Magento setup again, and the issue is resolved.
https://i.stack.imgur.com/gAEIQ.png

Related

Prestashop doesn't installs

I have xampp with PHP 7.3.2 installed on Windows 7.
I extracted the zip file that I downloaded from Prestashop website and I extracted it;
After doing that everything went fine except that on the "Store Installation" step I saw this error:
An error occurred during installation...
You can use the links on the left column to go back to the previous steps, or restart the installation process by clicking here.
1: Unable to write into "en-US"" (data layer : "PrestaShop\PrestaShop\Core\Localization\CLDR\DataLayer\LocaleCache")
Already tried to restart installation, deleting the whole folder and then re-extract the archive
Screenshot:
Screenshot
I think error happens at copy files start, it may be a permission files problem.
Try to set read and write permissions to everybody on PS installation directory.
EDIT:
In Windows 7 click right button mouse on folder and select Properties. Click on Security tab and here you can set users' permissions.
About install in a Flash Drive, FAT32 does not support permission management. Format it with NTFS or install on hard disk.

How to make wamp/apache to use htaccess?

I forked a working php project from github to create some json files to it, but i can't test it because js and css won't load, i have never used php in my life, so i followed what the install guide said.
composer install
edit .env
php artisan migrate:refresh --seed -vvv
testing vendor/bin/phpunit
This was the guide.
What i did step by step.
installed wamp64
cloned the repo into www
installed composer
ran the composer install command on the right folder
created virtual host for the folder with wamps add a virtual host option, named targygraf.test
created a db with phpmyadmin and set pw
edited the .env file to targygraf.test and to use the db and pw i created
ran php artisan migrate:refresh --seed -vvv
It did what it should i suppose because the database built up, and i was able to access the page with the server.php file, except that css and js didn't load.
Checked with the inspector and they were linked like this http://targygraf.test/server.php/assets/js/targygraf.js, i have visited a TON of forums about the problem, every single one said that i have to turn rewite_module on and set AlloweOverride to All so i did. But still nothing, and as i said earlier, the app was working on another pc and is working online right now, so i'm guessing i did something wrong.
This is the original github link: https://github.com/valentinxxx/targygraf
Edit1: corrected step 5 and 7, added original link
this is a Laravel project, so if it's your first time with php, it becomes a little more complicated.
In a few words:
laravel uses the routes at /routes/web.php, so: it's using: Route::get('/', 'HomeController#getIndex')->name('index'); for the home
/app/Http/Controllers/HomeController#getIndex calls layouts.index view .
this view uses /resources/views/template.blade.php. You can check your css and js there.
You can replace {{ url('assets/css/style.css') }} for '/assets/css/style.css' and see if this way the browser finds the file.
Anyway, there are other possible problems, keep in mind your Apache server should open "[project_folder]/public"
What I did to resolve this problem
reinstalled wamp and composer
forked a clean repo of the project
ran composer install
set phpmyadmin pw
created mysql table
created virtual host, this time pointing to [project_folder]\public instead of [project_folder] (This is the important part as with pointing to [project folder] the page will load but without css, but with the address pointing to [project_folder]\public the page works perfectly)
ran php artisan migrate:refresh --seed -vvv

Configuring php-cs-fixer and PATH variable

A while ago, I successfully configured Atom to beautify my PHP using php-cs-fixer, but now I need to go through the same process on another Mac and can't remember exactly how I did it.
As a front-end dev, I'm not a PHP expert, but I understand that the Atom plugin is merely the middleman facilitating the actual fixing using php-cs-fixer, which, by default, it doesn't have access to. Once I installed the fixer, I had to add its location to my PATH variable. The confusing part is that I don't have the fixer installed via Atom (checked ~/.atom/packages) nor Homebrew (confirmed with brew list), however, the file is present in /usr/local/bin. If I move it, Atom returns the original error, so it's definitely using this file:
See https://github.com/FriendsOfPHP/PHP-CS-Fixer for program installation instructions.
Your program is properly installed if running 'which php-cs-fixer' in your Terminal returns an absolute path to the executable. If this does not work then you have not installed the program correctly and so Atom Beautify will not find the program. Atom Beautify requires that the program be found in your PATH environment variable.
Note that this is not an Atom Beautify issue if beautification does not work and the above command also does not work: this is expected behaviour, since you have not properly installed your program. Please properly setup the program and search through existing Atom Beautify issues before creating a new issue. See https://github.com/Glavin001/atom-beautify/search?q=php-cs-fixer&type=Issues for related Issues and https://github.com/Glavin001/atom-beautify/tree/master/docs for documentation. If you are still unable to resolve this issue on your own then please create a new issue and ask for help.
Hide Stack Trace
Error: Could not find 'php-cs-fixer'. The program may not be installed.
at PHPCSFixer.module.exports.Beautifier.commandNotFoundError (/Users/ourcore/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:204:14)
at /Users/ourcore/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:304:22
at tryCatcher (/Users/ourcore/.atom/packages/atom-beautify/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/ourcore/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/Users/ourcore/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/Users/ourcore/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/ourcore/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:687:18)
at Async._drainQueue (/Users/ourcore/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:138:16)
at Async._drainQueues (/Users/ourcore/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:148:10)
at Async.drainQueues (/Users/ourcore/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:17:14)
at process._tickCallback (internal/process/next_tick.js:103:7)
which php-cs-fixer returns /usr/local/bin/php-cs-fixer and my PATH variable currently contains /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/ourcore/.atom/packages/php-cs-fixer.
I guess my questions are, how is the fixer working if the PATH variable seems to be pointing to it in a different location, and how did it end up where it is? Does the location in my PATH matter at all, or does the Atom plugin know to look in /usr/local/bin? I just want to fully understand the entire process before repeating it.
EDIT: On further testing, I removed the Atom directory from my PATH and it didn't affect the plugin, so then I copied the file into the same directory onto the second Mac and it ran without issue, without needing to edit the PATH. Does the fixer file someone inform the OS?
Well first test "which php-cs-fixer" or "where php-cs-fixer" (depending on what os you're running) and if nothing is returned in the terminal then there actually is something wrong on the installation and the best thing to do is to manually install it.
Head to https://github.com/FriendsOfPHP/PHP-CS-Fixer and download it from there and follow the installation steps, after that it should all be good

app_dev.php not always refreshing . How to contrain Netbeans/Browser to display freshest version of code?

it's so annoying.
I'm working with Netbeans and Chrome (but other browers are not better) and i never know whether an error comes from last edited code or previosly edited.
app_dev.php suppose to take care of that, but its not.
I do not know whose cache is responsible for this: Netbeans, Symfony, Browsers.
How to contrain displaying latest version of my code?
edit
if do following steps its not work well:
physically delete cache (even command cache:clear --env=dev)
change code
refresh site
if do following steps its work well:
change code
physically delete cache (dev)
refresh site
Netbeans is an IDE. It will not cache any files I think. Try following this steps:
Use Ctrl+F5 in Chrome to refresh the page with discarding the browser cache
Execute php app/console cache:clear --env=dev after each source code modification
Check your URL in browser address. It should be something like http://localhost/web/app_dev.php
#Olim pretty much covered it all. Only thing I would add is to try physically removing cache directory and running cache:clear again...
EDIT:
I had numerous problems with access rights of my IDE (phpStorm in my case) which could not alter files stored in Apache's default location (C:\Program Files\Apache...). The main cause was the dreaded Windows's UAC which prevented any program to write in some more sensitive locations.
To solve this you can either disable UAC or you could set the proper ownership:
Right click on you project's directory
Click Properties
Click the Security tab, then Advanced button
Switch to Owner tab and then Edit button
Click Other users and groups and enter your username. Click OK
Make sure you check the Replace owner on ....
Restart all related software (Netbeans, Chrome, Apache service...)
Does it work now?

Symfony2 permission issue in OSX local environment

I wanted to try out the local apache environment that comes with OSX Mountain Lion.
I did the basic setup and placed a project in the root directory
/Library/WebServer/Documents/
Jumped over too localhost in my browser and everything was working as expected.
However I then decided to follow this guide in order to use the Sites folder in my home directory, for simplicity sake.
http://osxdaily.com/2012/09/02/start-apache-web-server-mac-os-x/
I then reset apache and added this to my browser
http://127.0.0.1/~bengibson/PracTest/
The browser shows a list of a few of the files and directories in the project folder but not all of them :S.
I tried to navigate to one of the missing folders
http://127.0.0.1/~bengibson/PracTest/web/app_dev.php
But I get a forbidden message :(
Anyone know what this needs?
Just for reference here is the project folder
Heres the detailed view in of the folder in terminal
And here is what shown in the browser
I ran into this problem before on OS X when I downloaded the archive file for the Symfony 2 Standard Edition directly in the browser.
The # symbol at the end of the permissions table indicates that the file has additional attributes.
You can see these additional attributes by typing the following command in Terminal as an example, explained here.
$ xattr -l ~/Sites/PracTest/web/app_dev.php
The result returned is com.apple.quarantine.
This is the way OS X protects potentially malicious files downloaded from the internet from being readily available, which is why in Finder you get the warning box alerting you about opening a file downloaded from the internet.
In your case, to remove these extended attributes, run
$ xattr -rd com.apple.quarantine ~/Sites/PracTest
IF you wanted to know what this command does:
The -d flag removes the extended attribute specified after it, followed by the path.
The -r flag acts recursively, on all subfolders and files.
You should now be able to access both app.php and app_dev.php in the browser.
I'd also like to take the opportunity to recommend creating a new Symfony2 project with Composer rather than downloading it directly. It's hard to look back.
For anyone else who may happen on this blog, I had a similar issue and after a bit of looking around I found that I had forgotten the 'FollowSymLinks' Option in the username.conf file
sounds like permissions.
right click folder, get info, unlock with admin password bottom right and make all users able to read and write. then click the gear looking menu below it and tell it to apply to all contents within as well.

Categories