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 Complete Thread with Replies
Sponsored Links:
Related Forum Messages:
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
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
Unable To Change The File Attribute
I am not able to change the attribute of a file using the command chattr. Please see the output below. root@server [~]# lsattr /etc/exim.conf ----ia------- /etc/exim.conf root@server [~]# chattr -ai /etc/exim.conf root@server [~]# lsattr /etc/exim.conf ----ia------- /etc/exim.conf In fact, I can change the attributes for all the other files. I noticed that attribute of /etc is I root@server [~]# lsattr -d /etc ----------I-- /etc
View Replies!
View Related
How To Change Permissions Of A Read Only File System
I have a dedicated server and till few days back i was able to edit my files fine but this morning when i am trying to edit any file, it gives me back this error: [user@domainname theme]$ chmod 777 header.php chmod: changing permissions of `header.php': Read-only file system [user@domainname theme]$ [root@domainname theme]$ chmod 777 directoryy chmod: changing permissions of `directoryy': Read-only file system [root@domainname theme]$ I tried both as normal user and root and same results. Do you think the hosting guys changed the permissions of the file system or something?
View Replies!
View Related
Change Php.ini
I have a problem that am not able to connect with mssql_connect() function to MSSql server. Error is: undefined function mssql_connect(). On local this problem is get solved by uncomment extension=mssql_php.dll and extension=mssql_pdo_php.dll line by removing ";" in front of it. ::But how do i same on the online server?. ::If possible with coding or is thr any other way to do this plz let me know? ::If thr is a way to change .htaccess file to make this change or any better solution with .htaccess.. ::If thr ia a way to change the path for php.ini and we put our php.ini file in other folder and access that rather than php.ini on server.
View Replies!
View Related
How Do I Change PHP Email Info
When I changed hosts, the old mail.domain.com was left in the settings and now my newsletter script won't send out. I can see it listed on the PHP info page at the very top, first line after "System"System - Linux mail.domain.com 2.6.18-92.1.17.el5 #1 SMP Tue Nov 4 13:43:30 EST 2008 x86_64 How do I get into the settings to change the email from mail.domain.com to newmail.domain.com? Using Linux Centos 5, PHP 5, MySQL 5.
View Replies!
View Related
Trying To Change PHP Config On Linux Server
after a number of hours I finally got myself an SSH connection to my Linux server. I created an account with bin/bash access, whatever that is, and got in. Phew, this is all new to me! I can get to the ./configure prompt and all looks well when I type command --enable-magic-quotes but I refresh my phpinfo() and nothing has changed. All I want to do is install Joomla! My Joomla! installation tells me to action following: Set PHP magic_quotes_gpc setting to ON Set RG_EMULATION setting to `ON` instead of `OFF` in file globals.php Display Errors should be on Register Globals Emulation should be off instead of on It's also telling me that the var/lib/php/session is unwriteable. Do I need to get shell access and command to do that too?
View Replies!
View Related
MRSPUTNIK In UA String
I have been finding MRSPUTNIK in User Agent strings hitting my Website and was wondering if anyone had any insight. I can find other incidences online, but can't figure out what it is indicating. Has anyone else seen this? MRSPUTNIK 2 0 0 17 HW
View Replies!
View Related
Change Default Sender Address Using Php Mail() / Sendmail
I'm wondering if anyone else has experience with this, or if it's something easy that I'm overlooking. I am on a VPS service (CentOS Linux) and I want my php mail function emails to send from a specified address. I've already manipulated the headers, so the emails do appear to come from the specified addres, but on mobile devices it comes up as nobody@server1.mydomain.com format. I would like this to read something like no-reply@mydomain.com know which configuration files can change this default address?
View Replies!
View Related
Community String For Server
We have some Cisco servers that are being administrated by Affant. I recently downloaded a network management tool called SolarWinds and it looks really interesting and amazing because it can do so much for network monitoring. It seems that it needs not only the IP address for out server, but also a Community String. I tried the basic defaults (private, public) but they will not connect. I researched online and found some other defaults for a 3COM network, but none of those worked either. I was going to try and telnet through to the server but port 23 (default telnet port) is closed. Im sure its for security purposes. I also read online that if I used a packet sniffer, I would be able to sniff out packets which hed the community string in them. However, I could not find a sniffer which would actually do this. Any suggestions on a good packet sniffer that could do this? Also, If the telnet port is closed, is there any other way I could telnet into the server on a different port? Or maybe use some other way to access the server? I really want to use this program but I dont think my corperate office would like us to be monitoring it using this third party software, but us IT people dont really care... If there is anything you can help out with, it would be most appreciated.
View Replies!
View Related
Cron Job And Query String
Is it possible to call a cron job with a query string appended to the file. I have no problem setting up crons in the cron tab..but i'd like the cron to fetch a url that looks something like /home/php/some-file.php?a=1 is this possible directly through the cron job? I guess an alternative is call some php file that uses curl but i was wondering if there 's a direct way.
View Replies!
View Related
Missing Dependency: Perl(String::CRC32)
When running yum update from ssh, I've got this error: --> Processing Dependency: perl(String::CRC32) for package: lftp --> Finished Dependency Resolution Error: Missing Dependency: perl(String::CRC32) is needed by package lftp did try to removing the lftp, then yum update running like a charm but cannot re-install it ( lftp ) again.
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
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
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 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
Change Host, Change Domain And Getting Search Engines Up To Speed
Has anyone helped clients transition from one domain to another? Maybe dissolving a partnership or renaming their company... so a new domain name has been registered and a new website created. 2 Issues: #1 Using .htaccess 301 redirect We used the following command line in their old website's htaccess file Redirect 301 / [url] The goal was to get people try to visit any page of their old website (i.e. OldWebsite.com/contact.html) redirected to their new website (i.e. NewWebsite.com/contact.html). Isn't that supposed to change the address bar's URL, too? For some reason, I visit their old site and I seem to be redirected to their new website but the address bar still has their old domain name? Something is going on??? #2 Having their new company name for 2 years now. People can enter her new company name in Google, MSN or Yahoo. Her new company name appears in the search results but has the old domain name associated with it. We are trying to get rid of any reference to that old domain name? What's the easiest way to do this? So what people see in search engines is: New Company Short Meta Description www.OldDomain.com What steps did I miss in this transition? What steps do I have to take on their old website/old web server to control it's appearance on search engines and make sure people get to the new website?
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
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
Windows- PHP Exploit Being Used To Render All PHP Sites Useless
This has been happening for about 6 months, someone has been exploiting my windows server and causing 300 php.exe processes to run, therefore making the CPU usage go to 100% and cause all php sites to not function. It is a perl script, and I had gotten ahold of the explot, but am unsure how to block it, what the following is doing, and how to block it.. once I find the script again I will add it to the post.. I am using Plesk on my box.
View Replies!
View Related
Php Includes Issue On Linux Server With Apache 2.0.63 / Php 5.2.6
I am having some trouble with getting 'include' working. I have a new dedicated server running Apache 2.0.63 and PHP 5.2.6. Local includes on the same domain are running ok, but remote includes are throwing a problem. On the many sites we plan to host on this servber we use a central 'webmaster' page called as an include from a specific site (also on the same server). I need to edit the PHP.ini and /or recompile the PHP with the appropriate modules to do one of the following... 1 (ideally) - allow includes from any site that is held on this dedicated server 2. allow includes from specified websites 3. simply allow remote includes right settings to get one of these options running and solve my problem?
View Replies!
View Related
Update Php And Website Showing Php Code
I have update php successfully 5.2.6 to 5.2.9. -bash-3.2# php -v PHP 5.2.9 (cli) (built: Apr 10 2009 00:53:01) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies i already restart the httpd but everytime I go to my website, php page is now showing my php page as php code. :/
View Replies!
View Related
Php Passthru() Works From PHP CLI But Not Web
php passthru() works from PHP CLI but not web I have a script which I use to restart processes and I am trying to make it work by clicking a button on the word. It works from running it from php command line but I can never seem to get it to work through the click of a button. Does anyone know what may be the cause of this? here is some other observations: old php version 4 seems to work fine, but ever since around 4.3+ it just won't work from the web.
View Replies!
View Related
|