Locate and edit a WordPress .htaccess file in Google Compute Engine

淺唱寂寞╮ 提交于 2020-01-05 04:28:06

问题


I'm having trouble uploading my desired WP template (5mb), to my live site on vm instance within Google Compute Engine.

I've tried every ssh command I've been able to find, in order to increase the php.ini file limits and restarted apache etc. When I access them now, they appear to be amended as desired. However, when I re-attempt the install, I get the same file limit error within WP.

I've tried to sftp the files over to the WP folders using Fetch on OSX, to no avail. Permissions kept getting me.

Note that when I access top level WP folders/files, all the usual suspects folders/files are there... all except the .htaccess file?

Which leads me on to my question. Is it normal for a Google Cloud Launcher installed WP instance to have this missing, or is it in another location? Either way how best to check and if it isn't there what's the best process to push it over?

Also, I'm Looking to address the file limit issue mentioned above through: the following .htaccess entry:

php_value max_execution_time 3600
php_value upload_max_filesize 20M
php_value post_max_size 220M
php_value memory_limit 1024M

Any help is greatly appreciated.

Kind regards,

Craig

EDIT in relation to Wogsland's answer, see image below:

apache on Google Cloud Engine


回答1:


The Google Cloud doesn't use Apache, hence no .htaccess file.




回答2:


By deploying a new WP instance using Cloud Launcher and then SSH on it two different files appear:

user@wordpress-1-vm:~$ sudo find / -name "php.ini"
/etc/php5/apache2/php.ini
/etc/php5/cli/php.ini

Following the instruction on this discussion to identify the php.ini file being used.

How to know which php.ini is used?

php -i|grep 'php.ini'

Configuration File (php.ini) Path => /etc/php5/cliLoaded Configuration File => /etc/php5/cli/php.ini

In the same way you can also find .htaccess files:

user@wordpress-1-vm:~$ sudo find / -name ".htaccess"

/var/www/html/wp-content/plugins/akismet/.htaccess

Same topic is being discussed here. After making the changes in the configuration file make sure to restart the service.



来源:https://stackoverflow.com/questions/37603298/locate-and-edit-a-wordpress-htaccess-file-in-google-compute-engine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!