Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index.php plain text after install v2.4.4 #36123

Closed
5 tasks
francosmp opened this issue Sep 9, 2022 · 7 comments
Closed
5 tasks

Index.php plain text after install v2.4.4 #36123

francosmp opened this issue Sep 9, 2022 · 7 comments
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.4 Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@francosmp
Copy link

francosmp commented Sep 9, 2022

Summary (*)

Hello guys, help me please, I followed the next steps to deploy v2.4.4 but I'm getting the index.php's plain text after installation but I don't realized what's the error

--apache
https://devdocs.magento.com/guides/v2.4/install-gde/prereq/apache.html
apt-get -y install apache2
a2enmod rewrite
systemctl restart apache2
nano /etc/apache2/sites-enabled/000-default.conf
-- agregar AllowOverrideAll
<Directory "/var/www/html">
AllowOverride All

<Directory "/var/www">
AllowOverride All

<Directory "/www/htdocs">
AllowOverride All

systemctl restart apache2
apt-get update

--mysql o https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-20-04-es\
-- si estuviera la db en remoto https://devdocs.magento.com/guides/v2.4/install-gde/prereq/mysql_remote.html
https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/ o https://dev.mysql.com/downloads/repo/apt/
-- descargar el .deb
dpkg -i mysql.deb
apt-get update
apt-get install mysql-server -y
systemctl status mysql
-- conectarte
mysql -u root -p
set explicit_defaults_for_timestamp = 'ON';
create database magento;
create user 'magento'@'localhost' IDENTIFIED BY 'magento';
GRANT ALL ON magento.* TO 'magento'@'localhost';
flush privileges;

--php
https://devdocs.magento.com/guides/v2.4/install-gde/prereq/php-settings.html
apt-get install php8.1-bcmath php8.1-ctype php8.1-bz2 php8.1-cli php8.1-common php8.1-curl php8.1-dom php8.1-fileinfo php8.1-dev php8.1-gd php8.1-iconv php8.1-igbinary php8.1-imagick php8.1-imap php8.1-intl php8.1-mbstring php8.1-memcached php8.1-msgpack php8.1-mysql php8.1-opcache php8.1-pgsql php8.1-readline php8.1-redis php8.1-ssh2 php8.1-tidy php8.1-xml php8.1-xmlrpc php8.1-xsl php8.1-zip php8.1-soap php8.1-xdebug php8.1-fpm -y
para modificar el ini, buscarlo con esto php -i | grep "Loaded Configuration File" y para el otro find / -name 'opcache.ini'
date.timezone=America/Lima
memory_limit=2G
realpath_cache_size = 10M
realpath_cache_ttl = 7200
service apache2 restart

Instalar Java para ElasticSearch

apt-get install openjdk-8-jdk -y

Validar la versión con java -version

Instalar ElasticSearch

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.16.0-amd64.deb
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.16.0-amd64.deb.sha512

Checkear la integraidad de lo descargado

shasum -a 512 -c elasticsearch-7.16.0-amd64.deb.sha512

Instalar elasticsearch descargado

dpkg -i elasticsearch-7.16.0-amd64.deb

Modificar el autoinicio de nuestro servidor elasticsearch cada vez que se reinicie algo

systemctl daemon-reload
systemctl enable elasticsearch.service

Iniciar elastic

exec systemctl start elasticsearch.service

Probar Elastic haciendo curl (sudo apt-get install curl -y) o entrando

curl -X GET 'http://localhost:9200'

--composer
https://getcomposer.org/download/
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer

-- instalar el repo
cd /var/www/html
rm -rf *
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.4 .

Usuario: Public Key:

Clave: Private Key:

--Set file permissions
You must set read-write permissions for the web server group before you install the Magento software. This is necessary so that the command line can write files to the Magento file system.

find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
chown -R :www-data .
chmod u+x bin/magento

--Install Magento
bin/magento setup:install
--base-url=http://localhost/
--db-host=localhost
--db-name=magento
--db-user=magento
--db-password=magento
--admin-firstname=admin
--admin-lastname=admin
--admin-email=admin@admin.com
--admin-user=admin
--admin-password=admin123
--language=en_US
--currency=USD
--timezone=America/Lima
--use-rewrites=1
--search-engine=elasticsearch7
--elasticsearch-host=localhost
--elasticsearch-port=9200
--elasticsearch-timeout=15

Examples (*)

Proposed solution


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users with no workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
    Screenshot from 2022-09-09 10-38-33
@francosmp francosmp added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Sep 9, 2022
@m2-assistant
Copy link

m2-assistant bot commented Sep 9, 2022

Hi @francosmp. Thank you for your report.
To speed up processing of this issue, make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@francosmp
Copy link
Author

I tried a second installations of v2.4.3 with the next code

sudo apt-get install apache2 -y

Agregar permisos de servidor

sudo nano /etc/apache2/sites-available/000-default.conf

Agregar al final lo siguiente (control end)

<Directory "/var/www/html">
AllowOverride All

Agregar Nombre del servidor

sudo nano /etc/apache2/apache2.conf

Agregar al final lo siguiente (control end)

ServerName myip

Probar si la configuración es correcta

sudo apache2ctl configtest
sudo a2enmod rewrite
#Reiniciar apache
sudo systemctl restart apache2
sudo ufw allow 'Apache Full'

sudo apt -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.4 libapache2-mod-php7.4 php7.4-mysql php7.4-soap php7.4-bcmath php7.4-xml php7.4-mbstring php7.4-gd php7.4-common php7.4-cli php7.4-curl php7.4-intl php7.4-zip zip unzip php7.4-xml php7.4-bcmath mime-support php7.4-mcrypt -y

Ordenar la lectura del servidor para que lea primero archivos index.php, cambiar el orden de las extensiones para que php sea primero

sudo nano /etc/apache2/mods-enabled/dir.conf

Modificar la cantidad de memoria asignada

sudo nano /etc/php/7.4/apache2/php.ini

Modificar lo siguiente

memory_limit = 4G
date.timezone = Europe/London

date.timezone = America/Lima

#Reiniciar apache
sudo systemctl restart apache2

mysql installed as above

the same for elastic

Bajar composer https://getcomposer.org/download/

https://getcomposer.org/doc/articles/troubleshooting.md
sudo curl -sS https://getcomposer.org/installer | php

Moverlo a binarios para usarlo

sudo mv composer.phar /usr/local/bin/composer

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.3 .

Agregar permisos de archivos

find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} + && find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} + && chown -R :www-data . && chmod u+x bin/magento

Si lo de arriva no funca, darle sudo chmod -R 777 /var/www/html/

Instalar magento

bin/magento setup:install --base-url=http://192.168.1.112 --db-host=localhost --db-name=magento --db-user=magento --db-password=magento --admin-firstname=magento --admin-lastname=magento --admin-email=fsmeccap@gmail.com --admin-user=magento --admin-password=magento123 --language=es_ES --currency=PEN --timezone=America/Lima --use-rewrites=1

And im getting in chrome
An error has happened during application run. See exception log for details.

And debug logs says
[2022-09-09 20:35:54] main.ERROR: Error: Application is not installed yet. [] []
[2022-09-09 20:35:54] main.CRITICAL: TypeError: rtrim() expects parameter 1 to be string, bool given in /var/www/html/vendor/magento/framework/Encryption/Adapter/Mcrypt.php:171
Stack trace:
#0 /var/www/html/vendor/magento/framework/Encryption/Adapter/Mcrypt.php(171): rtrim()
#1 /var/www/html/vendor/magento/framework/Encryption/Encryptor.php(452): Magento\Framework\Encryption\Adapter\Mcrypt->decrypt()
#2 /var/www/html/vendor/magento/module-config/Model/Config/Backend/Encrypted.php(111): Magento\Framework\Encryption\Encryptor->decrypt()
#3 /var/www/html/generated/code/Magento/Config/Model/Config/Backend/Encrypted/Interceptor.php(32): Magento\Config\Model\Config\Backend\Encrypted->processValue()
#4 /var/www/html/vendor/magento/framework/App/Config/MetadataConfigTypeProcessor.php(133): Magento\Config\Model\Config\Backend\Encrypted\Interceptor->processValue()
#5 /var/www/html/vendor/magento/framework/App/Config/MetadataConfigTypeProcessor.php(152): Magento\Framework\App\Config\MetadataConfigTypeProcessor->processScopeData()
#6 /var/www/html/vendor/magento/framework/App/Config/PostProcessorComposite.php(36): Magento\Framework\App\Config\MetadataConfigTypeProcessor->process()
#7 /var/www/html/generated/code/Magento/Framework/App/Config/PostProcessorComposite/Proxy.php(95): Magento\Framework\App\Config\PostProcessorComposite->process()
#8 /var/www/html/vendor/magento/module-config/App/Config/Type/System.php(397): Magento\Framework\App\Config\PostProcessorComposite\Proxy->process()
#9 /var/www/html/vendor/magento/framework/Cache/LockGuardedCacheLoader.php(136): Magento\Config\App\Config\Type\System->readData()
#10 /var/www/html/vendor/magento/module-config/App/Config/Type/System.php(281): Magento\Framework\Cache\LockGuardedCacheLoader->lockedLoadData()
#11 /var/www/html/vendor/magento/module-config/App/Config/Type/System.php(207): Magento\Config\App\Config\Type\System->loadDefaultScopeData()
#12 /var/www/html/vendor/magento/module-config/App/Config/Type/System.php(181): Magento\Config\App\Config\Type\System->getWithParts()
#13 /var/www/html/vendor/magento/framework/App/Config.php(132): Magento\Config\App\Config\Type\System->get()
#14 /var/www/html/vendor/magento/framework/App/Config.php(80): Magento\Framework\App\Config->get()
#15 /var/www/html/vendor/magento/framework/App/Config.php(93): Magento\Framework\App\Config->getValue()
#16 /var/www/html/vendor/magento/module-new-relic-reporting/Model/Config.php(94): Magento\Framework\App\Config->isSetFlag()
#17 /var/www/html/vendor/magento/module-new-relic-reporting/Plugin/HttpPlugin.php(49): Magento\NewRelicReporting\Model\Config->isNewRelicEnabled()
#18 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(121): Magento\NewRelicReporting\Plugin\HttpPlugin->beforeCatchException()
#19 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception{closure}()
#20 /var/www/html/generated/code/Magento/Framework/App/Http/Interceptor.php(32): Magento\Framework\App\Http\Interceptor->___callPlugins()
#21 /var/www/html/vendor/magento/framework/App/Bootstrap.php(270): Magento\Framework\App\Http\Interceptor->catchException()
#22 /var/www/html/pub/index.php(29): Magento\Framework\App\Bootstrap->run()
#23 {main} [] []

@rogerdz
Copy link
Contributor

rogerdz commented Sep 10, 2022

mcrypt was DEPRECATED in PHP 7.1.0, and REMOVED in PHP 7.2 https://www.php.net/manual/en/intro.mcrypt.php
Magento uses sodium as an alternative to mcrypt
You try to check with php -m and make sure the list of php extension has sodium

@francosmp
Copy link
Author

It is already installed 😢

@rogerdz
Copy link
Contributor

rogerdz commented Sep 13, 2022

There's something wrong with your system, maybe openssl
Run command apt install php8.1-mcrypt maybe probably solve your problem but it not optimal

@engcom-Hotel engcom-Hotel added the Reported on 2.4.4 Indicates original Magento version for the Issue report. label Sep 13, 2022
@engcom-Lima
Copy link
Contributor

Hi @francosmp ,

Thanks for your contribution and collaboration.

Kindly provide us information in order to reproduce the issue.
Also go through the document one by one may be you are missing something from your end.

  1. System requirements
  2. Installation guide

Let us know if you are facing any issue.

Thanks

@m2-community-project m2-community-project bot added Issue: needs update Additional information is require, waiting for response and removed Issue: ready for confirmation labels Sep 30, 2022
@engcom-Hotel
Copy link
Contributor

Hello @francosmp,

We have noticed that this issue has not been updated for a period of 14 Days. Hence we assume that this issue is fixed now, so we are closing it. Please raise a fresh ticket or reopen this ticket if you need more assistance on this.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.4 Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
None yet
Development

No branches or pull requests

4 participants