CakePHP 3.5.2 auto deleted index.php file from webroot why? - cakephp

i use command : "cake server" to start the project.
It run the first time. The second time it give me this error
Warning: Unknown: failed to open stream: No such file or directory in
Unknown on line 0
Fatal error: Unknown: Failed opening required
‘C:\Users\duyqu\Desktop\page\webroot/index.php’ (include_path=’.;C:\php\pear’) in Unknown on line 0
I have check several time and it appear to delete the “index.php” file in webroot folder for no reason.
Here is what is already try:
-re-download Wamp server and composer
-update to newest version 3.5.2 of cakePHP
-copy the index.php to another place and recopy them back to webroot ( can’t be done because access denied)
I am stuck and have no idea what is happening. I have been use cakePHP for 6 months and this is the first

I think it could be antivirus. Everytime I create new project - everytime my antivirus tries to delete webroot/index.php

Related

Cake php upgrade showing error

I am new in cake php development, I have done a cake php upgrade from 2.7.5 to latest version 3. but i have some issues, when i try to run bin/cake server it shows below errors.
PHP Warning: include(Cake/Console/ShellDispatcher.php): failed to
open stream: No such file or directory in
/var/www/project_1/bin/cake.php on line 31 PHP Warning: include():
Failed opening 'Cake/Console/ShellDispatcher.php' for inclusion
(include_path='/var/www/lib:.:/usr/share/php') in
/var/www/project_1/bin/cake.php on line 31
PHP Fatal error: Could not locate CakePHP core files. in
/var/www/project_1/bin/cake.php on line 32
I can see the file cake.php which does not have any change but all other files moved from app to src folder, using cake php upgrade tool

Fatal error when updating joomla from 3.1.1 to 3.2.2

I updated my joomla site from 3.1.1 to 3.2.2 but now when I view my site I get
Fatal error: Call to a member function get() on a non-object in /home/studentw/public_html/plugins/system/remember/remember.php on line 96
I tried restoring my directory from a back up but I am still getting the error above. Line 96 of the remember.php file is:
$this->cookie_domain = $this->app->get('cookie_domain', '');
How can I fix this?
Google is your friend:
Rename your file remember.php to rememberBAK.php so it looks like this
/plugins/system/remember/rememberBAK.php
Find a copy of Joomla 3.1.15 and make a copy of the remember.php.
FTP the file to your folder
/plugins/system/remember/remember.php.
Now access your admin panel:
Go to Extensions -> Extension Manage -> Database.
Click Fix.
Now go to ftp, delete the remember.php that you uploaded and rename the original one to it's correct state.
Joomla updates do not update the database and this needs to be done manually.
For not developers, the above method is the simplest and quickest way
Source:Upgrade from 3.1 to 3.2 Fatal Error in Administrator Page

How to deploy CakePHP-application on CentOS?

I almost managed to deploy a CakePHP-application on CentOS-server, but it still needs little configuration. I have enabled mod_rewrite in /etc/httpd/conf/httpd.conf and restarted apache-server.
Then I have put Cake core library in /home/user/cakephp-core/
I get message "500 internal error" when i try to go to this page through web-browser.
In apache-logs I found following messages:
PHP Warning: include(/$HOME/cakephp-core/lib/Cake/bootstrap.php): failed to open stream: Permission denied in /srv/www/site/public_html/main/index.php on line 96
PHP Warning: include(): Failed opening '/$HOME/cakephp-core/lib/Cake/bootstrap.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /srv/www/site/public_html/main/index.php on line 96
PHP Fatal error: CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your /cake core directory and your /vendors root directory. in /srv/www/site/public_html/main/index.php on line 101
it says something about "permission denied"... to whom I should give permissions and where? I gave "apache:apache" to tmp/-folder... Any ideas?
Simply read the log and try to understand it.
It pretty clearly tells you what has insufficient permissions. The linux command to set permissions is chmod. You also want to make sure, as the text already tells you, that your CakePHP core include path is correct. Double check that too.

Varnish configuration not working

I have been installed varnish module in drupal 7 while clicking on configure it shows an error page with title server error and if i come back to module menu there was another error log
like Warning: require_once(/var/www/magz/sites/all/modules/varnish/varnish.admin.inc): failed to open stream: No such file or directory in menu_execute_active_handler() (line 515 of /var/www/magz/includes/menu.inc).
I tried reinstalling and some other stuffs but the error is still there is there any solution for this
Did you checked if the path and file (folder) is valid? seems that the module requires certain file which are not there.
I've checked with version: 7.x-1.0-beta2 and no such issue occurred.
Just to close out that the read permissions would cause this, please follow the instruction from that: page - regarding access rights setting.

Code to be executed before every page on server

I have an apache2 server, it has a vast and growing folder structure.
There is a set of instructions I would like to be executed at the beginning of every page in that website.
How do I implement that without pasting those very lines at the beginning of every file in the website?
I don't want to have the code at the beginning of every file.
I have tried changing the auto_prepend_file in php.ini to:
auto_prepend_file = ~/website_preview/say_hello.php
'say_hello' is a hello-world php script, but the script does still not get executed at all.
Wrong php.ini file, correct location is /etc/php5/apache2/php.ini
If all of your pages are in PHP, then I think you were on the right path with setting up auto_prepend_file in php.ini.
Try this:
Check your include_path in php.ini and if needed append a new path to it for your instructions file.
Copy your instructions.php file to the location from the include path.
Edit your auto_prepend_file in php.ini to be just the filename from step 2.
I tested this out and was able to get it working that way but had trouble specifying the path directly in the auto_prepend_file setting.
Also, when I had the auto_prepend_file setting configured improperly I received the following php error:
PHP Fatal error: Unknown: Failed opening required ...
Hope that helps.

Resources