Strip Whitespace From Each Line Of PHP File
I have a load of PHP files that need trimming down, so for example
Code:
<html>
<?php
$loads_of_stuff = 1231231;
?>
</html>
change to
Code:
<html>
<?php
$loads_of_stuff = 1231231;
?>
</html>
There are 000's of lines, so some awk command or something similiar would be great to execute on each file.
View Complete Thread with Replies
Sponsored Links:
Related Forum Messages:
Mod_rewrite Strip Off Php Extension
I am trying to figure out how to use mod_rewrite to make my php url's friendly. I have read a few articles but none seem to do what I want. Here is what I want: /login.php -> /login /home.php -> /home /users/update_profile.php -> /users/update_profile /users/update_profile.php?id=343242 -> /users/update_profile/343242 Basically just strip off the .php extension, so it seems like php files are actually folders.
View Replies!
View Related
Ffmpeg :: Cannot Open Shared Object File: No Such File Or Directory In Unknown On Line 0
Rapidly growing error logs showing the same message $ug-non-zts-20020429/ffmpeg.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20020429//usr/local/lib/php/extensions/no-debug-non-zts-20020429/ffmpeg.so: cannot open shared object file: No such file or directory in Unknown on line 0 root@server [~]# ls /usr/local/lib/php/extensions/no-debug-non-zts-20020429 ./ ../ eaccelerator.so* root@server [~]# ls /usr/local/lib/php/extensions/no-debug-non-zts-20020429 ./ ../ eaccelerator.so* Using cpanel 11 / centos 4
View Replies!
View Related
PhpBB2 Emailer.php Line 234 Error
I'm running CentOS with a postfix mail server. I haven't experienced mail problems on other CMS systems - so the basic setup should be working okay - but apparently not that well. I get the famous emailer.php line 234 error when some users send PMs to each other... The PMs go through, but the error is annoying none the less. Does anyone have a decent solution for this? The phpbb community advise to make a Google search (http://www.google.com/search?q=configuring+php+mail ) or use SMTP just don't do it for me - and I don't want to leave some big hole for spammers.
View Replies!
View Related
Links Files In Linux (file.txt For File.php)
Today I found some cstomer on the servers make a link for named it file.txt and link it to other customer php file. so that customer have the ability to show the other custoer file content when visiting the url because it is a text wile originally it is a php file. the php file was a config file, so now he know the database password , and because he is in the same server he can use that databse. the question , how to avoide this prolem in the future? notes , the SuExec is rnning and the open_basedir protection is enabled, but the problem still exists.
View Replies!
View Related
./chkrootkit.sh: Line 2: Cd: /downloads/chkrootkit-0.48/: No Such File Or Directory
I just try install but as title I have this error ./chkrootkit.sh: line 2: cd: /downloads/chkrootkit-0.48/: No such file or directory ./chkrootkit.sh: line 3: ./chkrootkit: No such file or directory I’m edite pico /etc/cron.daily/chkrootkit.sh and set it to #!/bin/bash cd /downloads/chkrootkit-0.48/ ./chkrootkit | mail -s "Daily chkrootkit from Servername" ****@****.com then I try make test by cd /etc/cron.daily/ ./chkrootkit.sh and it give me this error ./chkrootkit.sh: line 2: cd: /downloads/chkrootkit-0.48/: No such file or directory . ./chkrootkit.sh: line 3: ./chkrootkit: No such file or directory
View Replies!
View Related
Strange PHP File On My VPS. (oxb.php)
I found a strange PHP file in a strange folder on a VPS I am using to host a few sites. I've looked through the logs but can't figure out how it got there and I've look at the code and can't make any sense of it. Can somebody take a look at the code and tell me what they think of it: .....
View Replies!
View Related
PHP File Upload
I think I messed php config and I can't upload anything with php now Dir is chmoded on 777 and File_Uploads = On in php.ini I'm running lsphp5 with suhosin, when I try to import db via phpmyadmin I get error: Uploading is not allowed and when I try to upload some file via php script I can't
View Replies!
View Related
Php File Corruption
I have a Linux VPS with Liquidweb which is working fine except for one problem: On one domain I have a shopping cart (a highly modded CubeCart). A number of the files are encrypted php files (part of the extensive mods). For several weeks all will work fine, then out of the blue, the cart will stop working because a number of the encrypted files have become corrupt. The result is either a totally blank page or a 'checksum error'. Uploading the files from a local backup fixes things for another few days or weeks. I have no idea why this is happening, or what triggers it, so if anyone can point me in the right direction to find out what is behind the problem, I would greatly appreciate it. The server uses PHP 5.2.x
View Replies!
View Related
Cron: How To Run Php File
My server with cPanel, I'd like run file http://domain.com/file.php at 0h00 everyday, I have set the Cron Job in cPanel : Code: 0 0 * * * /usr/bin/ehpwget http://domain.com/file.php but The cron is not working well Code: /bin/sh: /usr/bin/ehpwget: No such file or directory Can any one please let me know how to run a php file with cron. (as user or root)
View Replies!
View Related
[php] <defunct> - What File Generating That ?
On my server, i have one user ho create load on my server. user 29508 22.0 0.0 0 0 ? Z 15:18 0:00 [php] <defunct> That user has more site added with addons from cpanel. How can I found witch site is generating that high load ? Also some time, I have php index.php ( and that don't help me very much ) The server run php as cgi module.
View Replies!
View Related
PHP Permissions (file Owner)
I have setup an ftp user which can upload files to /home/ftp/upload and obviously it assigns the ftp user as the owner when it uploads. Now, I want PHP to be able to rename those files, but getting a permission denied, presumably because apache aint the owner or doesnt have permission to do that, so how do I grant it the right permission(s)?
View Replies!
View Related
PHP File Change String
I currently have this code in my Image Upload script which changes the file name into sets of numbers and letters Quote: $new_file_name = "uploads/" . md5($_FILES['selector']['name'] . time()) . "." . $extension; How can i make it so its smaller than an md5, about 6 or 7 numbers and letters.
View Replies!
View Related
Mod_rewrite - Changing Paths In The Php File?
I am using mod_rewrite to create "pretty" urls but some of my files contain paths such as this: <img src="images/blah.jpg"> Meaning if the user visits a page where the file does not physically exist then it won't work. I want to know if it is possible to pick this up and rewrite the path. I.e.: change: <img src="images/blah.jpg"> to: <img src="../images/blah.jpg"> or <img src="../../images/blah.jpg"> As I don't want to create physical files with relative urls for every trunk of my url. For example: www.mydomain.com/directory/directory/directory/ Would need 3 different files in three different directories to display properly.
View Replies!
View Related
Prevent PHP Files Used For File Uploading
It appears that some people like to take advantage of those files for online web applications such as Wordpress which have php files with permissions set to 777. They use those as a means of creating an upload file. The upload files that they create then have access to the whole server somehow... Is there anyway of preventing this from happening?
View Replies!
View Related
Chmod Choices With Php Writing To A File
My account has been hacked with every index.php page defaced. I've cleaned up and my shared wehost is pointing at me saying there shouldn't be any 777 permissions for any files in there. I used 777 to allow php to add records in a txt file and in an xml file. Is there a better / more secure chmod code I can use? Those are the only two instances where I need php to write to a file and those files shouldn't be served to anyone, I do not want anyone to be able to access them. How can I secure them while letting php write in them?
View Replies!
View Related
Php.ini And .htaccess File Permissions
I'm on a shared FreeBSD server, running Apache with Drupal, and vBulletin. I had to create a local php.ini file in my public_html folder for Drupal, and another in my forum folder for vBulletin. Now my question is, what should I set the permissions of these files to? Also, what should I set .htaccess permissions to as well? I'd like to keep them invisible to the public. But, I don't want any problems with Drupal, or vBulletin ether. I'm used to using Linux and I know how permissions work on a desktop. I just don't know what they do when used on a server. I'm guessing 640, but I'd like to make sure before I change anything.
View Replies!
View Related
How To Prevent People Upload Unwanted .php File
I have a 777 cmod folder open. It needed to be writable so that legitimate users can upload their picture. However, i do not want people to upload .php or .php.pjepg etc to the server. There are times that they do not use the form in my site to upload the php file. How can they do that? via perl command? And how to prevent such thing from happending?
View Replies!
View Related
How To Secure Your Php.ini File Safe Mode ; Disable_functions ; Etc
what are the most important issues for secure php.ini file like when you turn your SAFE_MODE ON or OFF? or please who every read this topic to post his important disable_functions in php.ini ... and if some functions disable to post it ... let's make this subject for the most important issues for secure your php.ini from script-kids as we can ... here i have some important question's for anyone has or controlling a server ; vps .... #0x01 ; what the most important disable_functions for the php.ini? #0x02 ; is the safe_mode should be enabled? or disable? and this depend on what exacly? #0x03 ; what the functions or any trick to control the nobody ( attacker on the server or shell ) FROOZ .... didn't move ? or make any command in the server ... #0x04 ; i saw in some secure server ( as they say ) they changed the Server : discribe to them name[s] like Server : SECURE BY US .COM OR SECURE SERVER .. uname -a : Linux secure.secure.com 2.6.9-023stab040.1 #1 Mon Jan 15 23:24:32 MSK 2007 i686 athlon i386 GNU/Linux sysctl : linux 2.6.9-023stab040.1 Server : SECURE BY US ! < [THIS WHAT I MEAN HOW COULD WE CHANGE IT IN PHP.ini ?] id : uid=99(nobody) gid=99(nobody) groups=99(nobody) <[how can we cannot make this nobody to have the host id ! everyhost in the server should have his own name and php.ini ?] pwd : /home/host/public_html/ #0x05 ; how can we hide the uname -a on the shell [ the attacker upload it to our customer site !] #0x06 ; how can we hide the sysctl to view to anyone like [ attacker ] ... #0x07 ; how can we rewrite on he Server Type the display for our secure message?Server : SECURE BY US ! #0x08 ; how can we give evey site and customer his php.ini file in his public_html? and how can we give him [ JUST HIS PERMISSION TO HIS SITES FOLDER AND NOT OTHER PATHS AND PERMISSION!] these question every one had a server ; vps , need to know and secure his box from other ... and anyone would like to publish any new [secure or not] idea please let us know what you would like to say ....
View Replies!
View Related
Simpleish PHP/flat Files - Create File, Edit, Save
Display some text in a web browser from a file called text.txt text.txt will have many lines and some of them I do not want users to be able to modify and overwrite. config_item_1=user can edit config_item_2=user should see but not edit (could be on any line) config_item_3=user can edit config_item_4=user can edit The user has made their changes in the web browser and clicks submit. I then need this info to be saved as the text.txt file however some checking needs to be done first. Anything matching config_item_2 should be removed. This could be on any line. Anything not matching should be permitted and added.
View Replies!
View Related
Proc List Only Shows "/usr/bin/php" - No More File Names
We use cpanel on our centos servers and we've updated our servers recently using easyapache to the latest php4 and mod_suphp and I've noticed that in top (running "top c" in shell) all php processes by any user are simply displayed as "/usr/bin/php" Before this update the processes also showed the file name eg. "/usr/bin/php lamescript.php" which allowed to easily find troublesome scripts ... but now there's no way of knowing what the script in question is that's eating up 100% of the cpu .. or is there?
View Replies!
View Related
1Gbps Dedicated Line What Does That Mean?
I do not understand what network: 5 mbps and the traffic 1Gbps mean ========= CPU Intel Core2-Duo E4500 2.2GHz-FSB 800MHz -L2 2MB RAM DDR2 PC2-5300 (667Mhz) 2GB HDD SATA2 250GB (7,200rpm) LANcard Intel PRO/1000 PF Server Adapter Rack Type 1U (4.5cm) Network: 5Mbps Traffic 1Gbps Dedicated Line =======
View Replies!
View Related
Security Question Regarding T1 Line ..
This is our setup: We have two locations about 120 miles apart. We have direct connection with a T1 line. My question: How much safer is our data passing through the same T1 everyone else is using. Most people sending data through the same T1 line are using ISP, so are safer by not using an ISP? .........
View Replies!
View Related
Zip From Command Line
Im trying to zip up an sqlite database backup. I execute this command Code: zip ../d/db/backup.zip ../d/db/09-02-15.sqlite backup.zip never appears. Instead, I get some random filename in the directory. Like ziOHokOw If I try to zip a smaller file(last weeks backup) everything runs fine? Code: zip ../d/db/backup.zip ../d/db/09-02-08.sqlite So the 134mb file zips fine, but the 200mb one seems like its failing and im left with some type of temporary file. I tried downloading the weird filename and unzipping it. It has partial info like directory structure, the filename but the actual file inside is corrupt.
View Replies!
View Related
Linux Get Last Line Of Output
What command could I use to get the last line of an output? Heres why... I use this command: netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1 I would like to get just the last line of the output, the output looks like this: 1 203.118.105.* 1 80.195.165.* 1 87.211.51.* 1 91.40.90.* 8 82.2.222.* 213 The reason is because I'd like to get that last figure to place into a file on a certain time period (through a cron), which will then be graphed with PHP.
View Replies!
View Related
Ip Adjustment Via Command Line
Got a centos / cpanel box. Had to change the block of IP's with an entirely new block of 8. Problem is I cannot access cpanel/whm due to this, but only via ssh. If I run the below, it shows the old IP's /etc/init.d/ipaliases start How do I replace the old block with the new? I've never done it via command line before.
View Replies!
View Related
Trixbox Server Line
if anybody in the community looks for trixbox as the os to be installed on a dedicated server. I am looking for a new line of servers to provide and i am thinking that Trixbox could be one of them.
View Replies!
View Related
If There's 2 Ethernet Line, How Will The Traffic Be Like
I've a rack in the datacentre, and actually sharing the ethernet line with another partner's rack. Something like: Bandwidth -> Switch 1 -> Switch 2 (partner's rack) Bandwidth -> Switch 1 -> Switch 3 (my rack) After a previous uplinks issue, i'm never able to hit above 4Mbps of download speed to my home's cable broadband anymore. I have no idea whether it's because my partner capped my bandwidth from Switch 1, or his usage has increased such that it's affecting my traffic too. I can't be too concerned about it with him, as he's paying the bulk of the bandwidth costs. For the whole rack, i'm not able to hit above 5Mbps accumulatively, and my normal bandwidth usage is only about 1-2Mbps. So i'm thinking of getting another line for bandwidth directly from the datacentre to my Switch 3, perhaps starting from just 1-2Mbps only. How will things improve? Just a silly thought, whether my total available bandwidth can now be 5Mbps + 2Mbps = 7Mbps.
View Replies!
View Related
$100 Servers On 1 Gbit/s Line
I remember some companies were offering servers on 1 gbit/s line and 10 TB of bandwidth for $100/month. Or did I dream this one up? iweb was offering 10 TB/month servers for $99 (I don't remember if it was 100mbit/s or 1 gbit/s line though), they don't seem to offer this anymore.
View Replies!
View Related
Garbled Subject And From Line In Emails
I just moved to a new server and latly I've seen my mail going out like this: 071 Subject: =?iso-8859-1?B?U3BlZWRFYXJuZXIgUG9pbnQgRW1haWwgZm9yIHJhZmFu?= 039* Return-Path: Fast_Lane@XXXX.com 074F From: "=?iso-8859-1?B?U3BlZWRFYXJuZXIuY29t?=" <Fast_Lane@XXXX.com> Using Exim 4 and that was the same as my old server. I also moved the exim.conf file over to the new server to see if that would fix it, but it didn't.
View Replies!
View Related
Suggest Me A New Server With 50mbps Line
This is my current hosting Virtual Server - $60/Month 100GB disk 1 CPU 512MB dedicated RAM 768MB shared RAM 100mbit unmetered connection Now, I totally bombed the b/w. I am looking for a webhost that will allow 50-60mbps. I will be hosting anime, which is unlicensed.
View Replies!
View Related
Command Line On Shared Hosting
I have been looking around for a new shared host, I am currently with GoDaddy =( And it would be helpful to have command line access for some things I am trying to do. Particularly with Zend Gdata API (which GoDaddy has trouble with anyway) Is this reasonable to ask for? I also need at least 150GB/month bandwidth for some relatively high quality streaming video.
View Replies!
View Related
Website Backup Over Command Line
We have a dedicated server, with chroot access enabled. We are wanting to backup each site on this server, as well as all mysql dbs on a weekly basis. Is it possible for us to run a cron job to do this? If so, what commands would we want to use? We have a local FTP server here, so would like to ftp these backups this machine. I know it all sounds a little vague, but I just need to know where to get started.
View Replies!
View Related
Limestone Networks Support Line Not Picking Up
I just wanted to warn the rest of you as to my experiences with Limestone Networks. I've been calling them for half an hour now, and just keep getting a voice mail box. This is on top of the fact that the reason I'm calling it to check up on a ticket I submitted weeks ago which is still unresolved (they go for days without answering it, and then when I poke them about it they comment and disappear again for days). What is really disappointing is that all of this is after I spoke to one of their lead guys there, who gave me his email address and told me to bring any issues to him if I still had problems with the support. I sent him an email last week, and never got a response. So, if you're looking for excellent prices, great machines, an excellent control panel, and to be blown off my support, Limestone Networks is someone you should check out.
View Replies!
View Related
Dedicated Bandwidth 100Mbps International Line
i'm trying to look for a reliable server host where i need 1 Xeon server with a dedicated 100Mbps private bandwidth, can anyone advice or provide some kind of price quote so that i know what kinda range i'm looking at? i got sth from burstnet which is around 1300$/month for 100Mbps private.
View Replies!
View Related
|