« first day (1947 days earlier)      last day (3017 days later) » 

10:00 PM
@NikiC :)
@Andrew Ah, ok, good to know ... I will say that to him
 
@NikiC whats a file descriptor ?? sorry I am bad at english ..
 
"fd" ... @NikiC saw it to mean "file descriptor" instead of "friend"
 
@tereško This is one of the few things that I got it without asking :P
I feel I'm converting to a English man :-)
 
alright, have a good night guys :)
 
Oh, I think @NikiC understood it too. He just sucks at making jokes :P
 
10:04 PM
:-)
@Andrew Have a great night ( morning for you;-) )
 
user1648409
Hi guys. I have copied my project to centOS / Apache and tried deploying it, but i am getting the error " Uncaught --> Smarty: unable to write file". I googled for it and tried the top most 5 found "solutions". Nothing works: Setting all files / dirs to chmod 777, setting it to sudo chown apache:apache etc. Any more ideas on why smarty would fail to write the templates_c?
 
@tereško It was meant admonishingly ;)
@Shiuyin Did you create the folder it is trying to write them to?
 
user1648409
@NikiC i created the folders /cache and /templates_c in the project root as my local installation
 
user1648409
@NikiC i gave both of them 777 and apache:apache with chown.
 
@Shiuyin 755 would be safer and work just as well.
 
10:14 PM
In that case, dunno
 
user1648409
@NikiC :(
 
can you paste the complete path from root to templates_c and cache.
 
Wes
i'm in the weird part of youtube again time to go to bed. gn all
 
@Shiuyin that error has the full name after "Uncaught --> Smarty: unable to write file"
what is path that it is trying to write?
 
user1648409
wait, guys
 
user1648409
10:15 PM
PHP Fatal error: Uncaught --> Smarty: unable to write file /var/www/html/myproject/myproject/templates_c/wrt56c0d5e82b1ba6_54209343 <--
 
user1648409
Thats the complete path and correct path. The project root is in var/www/html/myproject/myproject/
 
do you have access to terminal on that server?
 
user1648409
Yes, i am via ssh on the server atm
 
what do you see when you write: ls -l /var/www/html/myproject/myproject/
 
@Shiuyin Have you seen this comment? digitalocean.com/community/questions/…
 
user1648409
10:16 PM
@tpunt Didn't see that one, will try in a second, thanks!
 
user1648409
@tereško I am seeing my normal stuff: The php files, the /php dir, /tmp, /objects, /js, etc, etc. I am also seeing /cache and /templates_c with both 777 and apache apache
 
For the record, I would recommend not putting directories to be written to directly under "myproject". Having a sub-directory that holds all writeable directories in a specific directory makes clearer, so:
/var/www/html/myproject/myproject/var/templates_c/wrt56c0d5e82b1ba6_54209343
@Shiuyin he gave you a specific thing to run....for a reason.
though only the line that contain templates_c would be interesting.
 
user1648409
pastebin.com/ezJ6sXF3 This is what i am seeing after ls -l /var/www/html/myproject/myproject/
 
user1648409
@tpunt That didn't fix it..
 
are you sure that PHP code is being executed with "apache" user?
 
user1648409
10:25 PM
@tereško I think so. That's how we intended it at least. But then again i am completely no linux expert... I don't even know how to check if it is currently executed with apache...
 
yeah.....either check the apache config, or make a little script that calls <?php echo exec('whoami');
 
user1648409
From httpd.conf:
User apache
Group apache
 
Oh, also make sure there isn't any file with the same name, already in that directory that is owned by root.
 
user1648409
@Danack what do you mean by "that directory that is owned by root" ?
 
If you ran some code as the root user, and it wrote the file /var/www/html/myproject/myproject/var/templates_c/wrt56c0d5e82b1ba6_54209343 already - then it would already exist but be owned by root.
Which means that apache user wouldn't be able to overwrite it.
 
user1648409
10:29 PM
/templates_c and /cache are completely empty...
 
do you get any messages in error log?
 
user1648409
@tereško Nope, i just checked apache's error_log and there is nothing related to it
 
It's possibly worth just restarting Apache - that shouldn't make any different, but everything else seems okay...
 
Ugh I suck at answering mail
 
10:33 PM
I just spent one hour writing a mail that ended up being 17 words :/
 
@FlorianMargaine What about it?
 
@NikiC I didn't know this existed
it makes my reimplementation of bash's pipe much easier
 
@FlorianMargaine The classic use case being, of course, the dup2,dup2,dup2,execve shellcode ;)
 
10:35 PM
@NikiC I just want pipe()/dup2/execvp
 
user1648409
Seriouly, fuck this. Why can it be so damn hard "just deploying" the code?
 
@Shiuyin because you don't know what you're doing :)
 
To be fair, we don't know what's wrong either...
 
it's ok, we've all been through this
 
user1648409
@FlorianMargaine Well i'm a a 5th semester student. How the hell am i supposed to know that stuff?^^
 
10:38 PM
@Danack pretty sure that one of us having ssh access to his server could fix it pretty quickly though, no?
 
@Shiuyin The next step is to debug it. Just to find more information write a simple script that does:
 
@Shiuyin but having it no work, fix it, build experience, don't repeat the same mistakes, understand what's happening, etc.
 
<?php

file_put_contents("/var/www/html/myproject/myproject/templates_c/wrt56c0d5e82b1ba6_54209343", "Argh why doesn't this work.");
 
user1648409
@Danack The fun thing is: Everything else is working. My webpage itself loads, just the templates won't load. So my normal php code is run without ANY problems.
 
(fixed to correct dir).
 
10:39 PM
@Danack it hates you
 
@Shiuyin lol. One of think I introduced in my previous workplace was "you should schedule 1 workday for deploying 'completed' website on the production box"
 
before that the project managers always assumed that "deploying" is something that needs 10-15min
 
user1648409
@tereško Well, we just updated the website. Simply copying some php code....
 
@tereško well, it should...
 
user1648409
10:40 PM
Ok guys, i found something:
 
@FlorianMargaine it should, but in real world it almost never is
 
user1648409
in the apache error_log i found "permission denied" for the cronjobs.php that is simply using mysqldump to make a backup of the current db
 
@tereško it is, with the service my company provides :P
 
there is always some fuckup: someone forgot to fix the config, VPS is broken, DNS has not propagated, DB version are incompatible, someone is being an idiot, etc.
 
10:42 PM
@Shiuyin that will need fixing later, but ignore it. Did you run the debug script for file_put_contents? And also the exec("whoami") ?
 
user1648409
@Danack On it, i just finished screening the error_log
 
@Shiuyin you dont need to screen it
 
user1648409
@tereško *reading line through line
 
you just write: tail -f /path/to/error_log .. press enter few times ... and hit F5 in the browser
 
user1648409
@tereško Nope, nothing happening. The eror_log won*t fill up. I even gave my test.php chmod 777 for testing. When i open it in the browser i get http 500...^^
 
10:45 PM
@FlorianMargaine in small-to-medium web development shop there is not dedicated dev-ops team
@Shiuyin that's kinda an improvement
although, it almost certainly means that your php is not being executed with "apache" user
 
user1648409
@tereško Nope, i set it to apache:apache and still "Server error 500" and no error messages with tail on error_log...
 
lol
 
user1648409
There seems to be something completely fked up with that apache installation....
 
have you disabled error logging?
 
user1648409
@tereško Of course not! 2 hours ago i still got the "permission denied" for the automatic backup script
 
user1648409
10:52 PM
Ok
 
user1648409
Got it
 
user1648409
PHP Warning: file_put_contents(/var/www/html/myproject/myproject/templates_c/wrt56c0d5e82b1ba‌​6_54209343): failed to open stream: Permission denied $
 
user1648409
The error logging for that specific project was redirected to a different logging file...
 
user1648409
But that still means that with chown apache:apache and 777 it has no permissions to do anything? wtf?
 
@Shiuyin and you ran the exec("whoami") one?
 
10:55 PM
"/var/www/html/myproject/myproject/templates_c/"
 
user1648409
@Danack No HTML output for that one and no error message with tail
 
do you really have "myproject" twice in that path?
 
user1648409
@tereško Yes, needed by default for some stupid reverse proxy of my university that only listens to that location or something like that...
 
who are you logged in as on the server?
 
user1648409
@Danack root
 
11:04 PM
maybe try:
su apache
touch /var/www/html/myproject/myproject/templates_c/wrt56c0d5e82b1ba‌​6_54209343
ls -l /var/www/html/myproject/myproject/templates_c
that should create a file in the dir....which you might also want to remove.
 
user1648409
Oh
 
user1648409
"This account is currently not available."
 
user1648409
I can't even switch to apache
 
that might be normal....apache can be a "privileged account" that can't be logged into.
 
@Danack if server was not set up by an idiot, apache user probably has /bin/nologin set as shell
or some alternative of that
 
user1648409
11:06 PM
@tereško Yeah, the Server was set up for me by a very very good guy who's working on that for 20+ years
 
user1648409
@tereško However i have no idea about centOS and it seems he very tightly restricted some stuff on the server
 
user1648409
LOL
 
user1648409
i got it working
 
user1648409
holy shit
 
something obvious?
 
user1648409
11:08 PM
no
 
user1648409
SELinux was blocking apache from writing dirs / files
 
user1648409
i just used setenforce 0 to disable SELinux
 
user1648409
which is obviously not good..
 
oh .. the joy of SELinux
 
user1648409
Well guys
 
user1648409
11:10 PM
Thank you very, very much for helping
 
np - btw httpd_sys_rw_content_t might be a useful thing to google.
allegedly.
 
user1648409
@Danack Already googled it. But i won't touch that stuff at 0am ... Need to sleep^^
 
always a good idea. nn.
 
user1648409
Night guys
 
user1648409
and thanks again
 
11:57 PM
mornings
 

« first day (1947 days earlier)      last day (3017 days later) »