access static file in public_html/tmp without going trough controller in cakephp - cakephp

I have uploaded my cakephp app to cpanel and adjust and configure it to works with cpanel. Everything mostly works, however i find out that try to retrieve static file from tmp in public_html result in error. It tries to go to controller i think.
My structure is like this :
/cakephp139
/cake
/vendors
/renttycoons <= this is app folder
/public_html
/tmp
/js
....
I tried to access www.domain.com/tmp/test.csv, but result in errors although the test.csv was there. This is the error :
Error: The requested address '/403.shtml' was not found on this server.
Any idea would be appreciated. Thanks

does it gives you cake like error? it seems like a permission error.
erorr 403 is forbidden error, not a not found or something like that. Your server gives you that error and tries to show you a page for that error that is not found so you are receiving a 404 for not having a page for a 403 error hehe.
It must be a permission error, try changing permission to 705 in the temp folder, your test.csv file included. If you are creating it with php, php normally creates them with the minimun permission, at least that happened to me... you may use chmod function in php to change the permissions after creating a file.

Related

SuiteCrm Install error

I´m installing suiteCrm version 7.10.2, license agree works fine, system check works fine but when i´m done with the database and sdmin config and hit next don´t appen anything. I check the console and get the ReferenceError: YAHOO is not defined
I´m installing in my domain and not locally.
In chrome console i get this error
install.php:14 GET https://www.digitalinput.pt/SuiteCRM-7.10.2/cache/include/javascript/sugar_grp1_yui.js?s=6.5.25&c= 404 (Not Found)
but the file exists and i add a 777 permission just to try and nothing changes!
Check your .htaccess file. I can see you are using a subdirectory so make sure you have
rewriteBase /SuiteCRM-7.10.2
That should fix the 404.
you need to give the 'cache' folder write access (Recursively)
if you have access to ssh, you can run this commmand on you terminal :
Note : you need to be in the crm folder path
chmod 0777 -R cache/
then you refresh the page back

save pdf on server fpdf

I am generating a pdf with fpdf in cakephp and I try to save it on the server.
I do it like this :
$fpdf->Output("D:/Files/mypdf.pdf",'F');
but it doesn't save.
I think it doesn't find the folder, but I don't know how specified it?
I have put the all the right on the folder.
I don't know if it is a cakephp restriction or just my directory?
Try this
$fpdf->Output(WWW_ROOT."files\mypdf.pdf", 'F');
As this code works fine locally, it's probably server-problem.
(1) Are you sure you can create files? Most free servers disallow creating files.
(2) Have you tried it with different location e.g. the current root location $fpdf->Output("mypdf.pdf",'F')
Anyway, you should enable error reporting in your index.php. If it was matter of directory not found you would get this result:
Warning (2): fopen(D:/Files/mypdf.pdf): failed to open stream: No such file or directory [ROOT\vendor\fpdf\fpdf.php, line 1025]
FPDF error: Unable to create output file: D:/Files/mypdf.pdf
Just a wild guess but change the slashes to windows style.
$fpdf->Output("D:\Files\mypdf.pdf",'F');
or even
$fpdf->Output("D:\\Files\\mypdf.pdf",'F');

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.

Server giving 404 not found

I am deploying a spring application which contains files with around 100000 entries. Each row in the file has about 23 chars.
The app deploys fine when a file has 100000 entries but when I increase the contents to 400000 entries, when I access my app url I get a 404 Not found error.
I need to figure out what causes the crash ( whether a memory problem or something else ) but I do not see anything erroneous in the tomcat log files, using the command vmc files [app_name] tomcat/logs/catalina.... just info messages related to server startup.
Are there other options to debug the issue?
Thanks,
Cristian
I would look into what Dan has mentioned! Also can you look at the logs folder to see if the files there give more information.
vmc logs <app-name>
or
vmc files <app-name> logs/stderr.log
vmc files <app-name> logs/stdout.log
Okay, the application was using too much memory, as a result the Java processes was being destroyed causing the router to return a 404 when trying to route to the application.

Resources